Code:#include <iostream> #include <string> using namespace std; class Class { public: string s; string get_s() { static string _s = s; return _s; } }; int main() { Class c; c.s = "Hello world"; cout << c.get_s().c_str(); }
| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | VB Forums | Developer.com |
|
Results 1 to 3 of 3
|
Click Here to Expand Forum to Full Width |