about .h file
-
- Sometimes I do not include certain .h file(s), but the app still runs ok. I do not know why. Are there any defaults .h file(s)? - Can you give me an example? - Best regards, Maer
There are no default .h files, you're probably either including stuff you don't need, or you're including other headers that #include the other ones you need. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
-
There are no default .h files, you're probably either including stuff you don't need, or you're including other headers that #include the other ones you need. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
I am not sure about this Christian, but I think some headers are auto-inserted or perhaps they are in some pre-compiled format. I use strcpy and strcmp without including string.h and I dont get errors. Nish Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic -
I am not sure about this Christian, but I think some headers are auto-inserted or perhaps they are in some pre-compiled format. I use strcpy and strcmp without including string.h and I dont get errors. Nish Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevicstring.h is the basic_string class, I believe. strcmp and strcpy are both part of the core C++ which you get for free, i.e. without having to include any external libraries, such as stdio, iostream, list, map, etc. I'm not sure on this, but I'd say that the stuff you get for free is some sort of superset of the stuff that comes with C, and that the whole point is one of not including too much above C as default, because I know Stroustrup worked hard to make sure C++ was not much bigger or less fast than C. This is one major reason ( and the one he usually gives ) as to why there is no garbage collection built into C++. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
-
string.h is the basic_string class, I believe. strcmp and strcpy are both part of the core C++ which you get for free, i.e. without having to include any external libraries, such as stdio, iostream, list, map, etc. I'm not sure on this, but I'd say that the stuff you get for free is some sort of superset of the stuff that comes with C, and that the whole point is one of not including too much above C as default, because I know Stroustrup worked hard to make sure C++ was not much bigger or less fast than C. This is one major reason ( and the one he usually gives ) as to why there is no garbage collection built into C++. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Thanks. I guess you are correct. Because the moment you use an API call, you need to include the required header file. I think most of the header files used by CRT functions are auto-inserted for us. Some like "process.h" need to be manually included. Regards Nish Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic -
I am not sure about this Christian, but I think some headers are auto-inserted or perhaps they are in some pre-compiled format. I use strcpy and strcmp without including string.h and I dont get errors. Nish Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran IvanisevicNope, try this: - Create an "Empty" Win32 Console app. - Create a new file and add this to it:
void main()
{
char abc[4];
strcpy(abc, "abc");
}- Save the file and add it to the project. - Build. You'll find that it doesn't work unless you include string.h at the top. Moral of the story: the C compiler does not include any default headers (unlike Java which always gives you the java.lang.* package). Regards, Alvaro