Code:class String { protected: std::string string; public: String operator= (char *str); } String String::operator= (char *str) { string = str; }
I want this to function like the string class that when you create a string you can assign a char pointer to it.
For instance, I want to be able to do:
Code:String s; s = "Hello, world!";
However, when I try to run that my program crashes. Is there something I'm doing wrong?



LinkBack URL
About LinkBacks


