Possible Duplicate:
What is the difference between using #include<filename> and #include<filename.h> in c++
I’ve never noticed it making any difference whether or not I include the .h at the end of an include, so I’ve always ignored the meaning, but I’ve just noticed in a particular program of mine, I get the error “memcpy was not declared in this scope” if I include “string”, but not if I include “string.h”.
First of all, I was wondering the specific cause of this, but also generally the difference between the two. At the same time, if someone could explain the difference between includes in angular brackets and those in quotation marks, It’d be much appreciated.
<string>is the C++ standard library string header file containingstd::stringand its friends.<string.h>is a different header, from the C standard library, which has functions for manipulating C strings (null-terminated strings) and other related functions.The two are entirely different and unrelated. In C++ (as in C), a header file can have any extension. The C++ standard library headers have no extension; the C standard library headers have a
.hextension..hppor.hxxare also common.