char * to char[]

Started by
14 comments, last by bytecoder 19 years, 8 months ago
string.h contains the C standard library string functions. If you want std::string you have to #include <string>.
Advertisement
yeah, string.h is the C library. Do:

#include <string>

using namespace std;

string blah;
As aWG said, <string.h> is only a C library thing. To get the C++ std::string stuff, you need to include <string> (no ".h").

[edit: wow, slow indeed.]
"We should have a great fewer disputes in the world if words were taken for what they are, the signs of our ideas only, and not for things themselves." - John Locke
#include

notice, no .h extension
I screwed up forgot about html formatting :)

should have been
#include <string>

Wow. We all posted within a minute of each other :/
Quote:
As aWG said,...

Sure. Just ignore bytecoder ;)

This topic is closed to new replies.

Advertisement