What is the header I need to declare a string? Not an array or char, but a string. I tried <string>, <string.h>, but I still get an error when trying to do something like:
string message;
What is the header I need to declare a string? Not an array or char, but a string. I tried <string>, <string.h>, but I still get an error when trying to do something like:
string message;
<cstring>
edit: nevermind, errors still show up for this also.
Last edited by alpha; 01-26-2003 at 01:59 PM.
The correct header for the string class is <string>, but if you don't handle namespaces anywhere you'll get errors, so you need to do one of these.
Code:#include <string> using namespace std; ... string message;Code:#include <string> using std::string; ... string message;Code:#include <string> ... std::string message;
*Cela*
yeah, i forgot the std stuff. i didn't know if you don't do using namespace std; or using std::string; that you need to do std::string for declaration. just tried it, no errors.