• Advertisement

Archived

This topic is now archived and is closed to further replies.

string type

This topic is 5883 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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=-

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
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 name

std::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;

Share this post


Link to post
Share on other sites

  • Advertisement