Quote Originally Posted by skycrazy123
I declared them private in the header, and it seemed to work.
Yes, that is a correct fix since you want info to a non-static member variable so that each MyClass has its own copy.

By the way, you should #include <string>, not <string.h> since you are using std::string instead of the string functions inherited from C (in which case you should #include <cstring>). Also, you should remove the using directive at file scope (using namespace std; ) from the header file. To be const-correct, your get_info() member function should be declared const.