header-files

Header files for x86 SIMD intrinsics

不想你离开。 提交于 2019-11-26 08:39:11
问题 Which header files provide the intrinsics for the different x86 SIMD instruction set extensions (MMX, SSE, AVX, ...)? It seems impossible to find such a list online. Correct me if I\'m wrong. 回答1: These days you should normally just include <immintrin.h> . It includes everything. GCC and clang will stop you from using intrinsics for instructions you haven't enabled at compile time (e.g. with -march=native or -mavx2 -mbmi2 -mpopcnt -mfma -mcx16 -mtune=znver1 or whatever.) MSVC and ICC will let

Difference between <string> and <string.h>?

穿精又带淫゛_ 提交于 2019-11-26 08:14:08
问题 How come this code std::map <std::string , int> m; m[\"a\"]=1; compiles with (I\'m using MSVC 2010) #include <string> but not with #include <string.h> ? 回答1: <string.h> contains old functions like strcpy , strlen for C style null-terminated strings. <string> primarily contains the std::string , std::wstring and other classes. 回答2: string.h is a C header not a C++ header, period! 回答3: <string.h> is cstring - http://www.cplusplus.com/reference/clibrary/cstring/ <string> is the c++ string class

List of standard header files in C and C++

独自空忆成欢 提交于 2019-11-26 07:55:49
问题 Where could I find the list of all header files in C and C++? While I am building a library, I am getting an error like \' tree.h not found \'. I suppose this is a standard header file in C and C++. This raised in me the curiosity to know all the header files and their contribution. Is there a place I can search for? I am working on Solaris Unix. 回答1: Try here : http://en.cppreference.com/w/ However, you may also be refering to the header files of your OS. These can be found either on MSDN

using namespace std; in a header file

我怕爱的太早我们不能终老 提交于 2019-11-26 05:37:51
问题 So, I have the following in a specification file #include <string> #include <fstream> using namespace std: class MyStuff { private: string name; fstream file; // other stuff public: void setName(string); } I also have in the implementation file #include \"MyStuff.h\" using namespace std; void MyStuff::setName(string name); { name = name } and in the program file I have... #include <iostream> #include <string> using namespace std; void main() { string name; MyStuff Stuff; cout << \"Enter Your

How to read a CMake Variable in C++ source code

不想你离开。 提交于 2019-11-26 04:45:50
问题 I\'d like to store the version number of my library in just one place. So I have defined such a variable in the CMake-file: SET(LIBINTERFACE_VERSION 1 CACHE INTEGER \"Version of libInterface\") With this definition I can generate a version.rc file according to Microsoft\'s definition, which I compile into the library and afterwards shows up correctly in the properties window of my dll-file. Now I\'d like to use this CMake variable in my c++ source code too, but I actually don\'t get to a

Difference between iostream and iostream.h

烂漫一生 提交于 2019-11-26 03:40:51
问题 What is the difference between iostream and iostream.h ? 回答1: iostream.h is deprecated by those compilers that provide it, iostream is part of the C++ standard. To clarify explicitly there is no mention of iostream.h at all in the current C++ standard (INCITS ISO IEC 14882 2003). Edit: As @Jerry mentioned, not only does the current standard not mention it, but no standard for C++ mentions it. 回答2: iostream is a standard header. iostream.h is a non-standard header that was very common in pre

Difference between @interface definition in .h and .m file

浪尽此生 提交于 2019-11-26 03:37:50
问题 Normally we use @interface interface_name : parent_class <delegates> { ...... } @end method in .h file and in .m file we synthesis the properties of variables declared in .h file. But in some code, this @interface.....@end method is kept in the .m file also. What does it mean? What is the difference between them? Also give some words about getters and setters for the interface file that is defined in .m file... Thanks in Advance 回答1: It's common to put an additional @interface that defines a

What should go into an .h file?

梦想的初衷 提交于 2019-11-26 01:29:39
问题 When dividing your code up into multiple files just what exactly should go into an .h file and what should go into a .cpp file? 回答1: Header files ( .h ) are designed to provide the information that will be needed in multiple files. Things like class declarations, function prototypes, and enumerations typically go in header files. In a word, "definitions". Code files ( .cpp ) are designed to provide the implementation information that only needs to be known in one file. In general, function

What is the difference between #include <filename> and #include “filename”?

≯℡__Kan透↙ 提交于 2019-11-26 01:18:19
问题 In the C and C++ programming languages, what is the difference between using angle brackets and using quotes in an include statement, as follows? #include <filename> #include \"filename\" 回答1: In practice, the difference is in the location where the preprocessor searches for the included file. For #include <filename> the preprocessor searches in an implementation dependent manner, normally in search directories pre-designated by the compiler/IDE. This method is normally used to include

Makefile, header dependencies

笑着哭i 提交于 2019-11-26 01:05:17
问题 Let\'s say I have a makefile with the rule %.o: %.c gcc -Wall -Iinclude ... I want *.o to be rebuilt whenever a header file changes. Rather than work out a list of dependencies, whenever any header file in /include changes, then all objects in the dir must be rebuilt. I can\'t think of a nice way to change the rule to accomodate this, I\'m open to suggestions. Bonus points if the list of headers doesn\'t have to be hard-coded 回答1: If you are using a GNU compiler, the compiler can assemble a