If this compiles and runs, you have a different problem. Make sure you're including iostream and possibly the string header string.Code:#include <iostream> int main() { std::string str("Hello, world!"); std::cout << str << std::endl; return 0; }
If this compiles and runs, you have a different problem. Make sure you're including iostream and possibly the string header string.Code:#include <iostream> int main() { std::string str("Hello, world!"); std::cout << str << std::endl; return 0; }
Thats the whole thing, and it doesn't work.... I wonder...Code:#include <string.h> #include <iostream> class TextEngine { void Respond() { std::cout << Response << std::endl; } std::string Response; };
Sometimes I forget what I am doing when I enter a room, actually, quite often.
All of the class members are private, so calling Respond() outside of other class member functions is impossible. Might I add that MacGuyver has the simplest idea with the least boilerplate code.
I forgot about string and string.h
Ooops! :d
Sometimes I forget what I am doing when I enter a room, actually, quite often.