Advertisement

string type

Started by September 24, 2001 01:50 AM
2 comments, last by minority 22 years, 10 months ago
ok, i included string.h but i still can''t declare a string... any help, pls................. Error C0000: No dirty 4 letter words allowed
-=Idiot of the Net=-
Error C0000: No dirty 4 letter words allowed
-=Idiot of the Net=-
I think you have to include string (not .h)
and then have the following line:
#using namespace std;


Edited by - Zook on September 24, 2001 3:02:39 AM
Advertisement
there shouldn''t be a #-character before the using-statement. Only preprocessor commands are preceeded by a #-character, and using is not a preprocessor command.

i.e.
  using namespace std;string s;  

Alternatively, you can instead use the std:: qualifier on each occurrence of string, for example:
  // declare a string using a fully qualified namestd::string s;  

Or, by ''importing'' only the string-type from the namespace std, instead of importing the whole namespace (which is what the ''suing namespace std'' statement will accomplish),
  using std::string;string s;  
  #include <string>...//to declare stringsstd::string imastring;  

This topic is closed to new replies.

Advertisement