www.digitalmars.com         C & C++   DMDScript  

c++ - string.h

reply "someone" <ipivin hotmail.com> writes:
Hi all
I am including string.h in my code, but when I use the class string I get an
error from the compiler that it`s an unknown identifier.
any ideas?
thanks
Igal
Nov 25 2003
parent reply "Charles Sanders" <sanders-consulting comcast.net> writes:
using std::string;

or

using namespace std;

?

C

"someone" <ipivin hotmail.com> wrote in message
news:bq03pn$2pv2$1 digitaldaemon.com...
 Hi all
 I am including string.h in my code, but when I use the class string I get
an
 error from the compiler that it`s an unknown identifier.
 any ideas?
 thanks
 Igal
Nov 25 2003
parent "Charles Sanders" <sanders-consulting comcast.net> writes:
Also , are you trying to using string.h from cstdlib, or std::string's
string.

If the latter, then the new convention is to not include the .h at the end,
ie

#include <string>
#include <iostream>

and the old C headers are now

#include <cstring>
#include <cstdio>

etc...

just FYI.

C

"Charles Sanders" <sanders-consulting comcast.net> wrote in message
news:bq0482$2qmr$1 digitaldaemon.com...
 using std::string;

 or

 using namespace std;

 ?

 C

 "someone" <ipivin hotmail.com> wrote in message
 news:bq03pn$2pv2$1 digitaldaemon.com...
 Hi all
 I am including string.h in my code, but when I use the class string I
get
 an
 error from the compiler that it`s an unknown identifier.
 any ideas?
 thanks
 Igal
Nov 25 2003