In ANSI C++, <string> and <string.h> are two completely different files.
string.h is all the old string manipulations from C, while string is the
C++ class string, which is defined in the namespace std.  So, if you want
to use the string class, you  need to inlude the header file that contains
it (<string>) and then access the namespace.

On Fri, 19 Nov 1999, Faisal Naeem wrote:

> Hi,
>     When I try to compile a program that uses the C++ class string , G++
> goes haywire cos it includes string.h from the C stdlib instead of the C++
> stdlib.The only way I can make it work is say 
> 
> # include <string>
> using namespace std;
> 
> if i dont use namespace , and use 
> #include <string.h>
> it foobars.
> What am I doing wrong?
> 
> 
> Every man dies, not every man lives
> William Wallace ( BraveHeart)
> 
> 
> 
> 
> ---------------------------------------------------------------------------
> Send administrative requests to [EMAIL PROTECTED]
> 

---------------------------------------------------------------------------
Send administrative requests to [EMAIL PROTECTED]

Reply via email to