From: Carmen Sei on
it seem to me that when doing include -

#include <string.h> - is CRT
#inlcude <string> - is C++ standard library

Is that true those header with .h extension is CRT and those without
extension <string> is C++ standard library headers?
From: Carl Daniel [VC++ MVP] on
Carmen Sei wrote:
> it seem to me that when doing include -
>
> #include <string.h> - is CRT
> #inlcude <string> - is C++ standard library
>
> Is that true those header with .h extension is CRT and those without
> extension <string> is C++ standard library headers?

No, not in general. What is true though is that all standard C library
headers end with .h, and all standard C++ library headers omit the .h.
Headers from libraries other than the C or C++ standard libraries may or may
not use the .h at the authors discretion. The compiler doesn't care - they
could just as well be .txt files as far as the compiler is concerned.

-cd


From: Alex Blekhman on
"Carmen Sei" wrote:
> it seem to me that when doing include -
>
> #include <string.h> - is CRT
> #inlcude <string> - is C++ standard library
>
> Is that true those header with .h extension is CRT and those
> without
> extension <string> is C++ standard library headers?

In addition to Carl's answer. It is not uncommon to use standard C
headers in C++ program. However, C++ standard library incorporates
CRT and provides CRT's headers with "c" prefix in their name and
without ".h" extension. So, CRT headers are streamlined with C++
standard headers. For example:

#include <cstring> - is CRT
#inlcude <string> - is C++ standard library
#include <cassert> - is CRT

Here you can see the full list of CRT headers provided by C++
standard library:

"Header Files"
http://msdn2.microsoft.com/en-us/library/a7tkse1h.aspx

HTH
Alex



 | 
Pages: 1
Prev: Init COM interfaces
Next: cout