Advertisement

Help with string class in VC++

Started by August 18, 2002 09:18 PM
10 comments, last by wombatvvv 22 years, 6 months ago
Thanks Magmai Kai Holmlor,

Looks like you''ve fixed my problem. It was something to do with that namespace stuff and the ''std::'' bit. I haven''t got a clue what any of that is, as my C++ book doesn''t mention any of it.

I''ll have to have a look for an online tutorial on namespaces, I guess. Recomendations?

The working Visual C++ snippet was:-

#include <iostream>
#include <string>

main()
{
std::string str;
using namespace std;
str = "Hello World!";
cout << str << endl;

return 0;
}


Thanks all!
Okay, just checked out an online tute on namespaces. Geez, it''s so simple. All that frustration for nothing. Now I know how to use them, and exactly why my program was throwing errors.

Thanks everyone.

This topic is closed to new replies.

Advertisement