As kevinkjt2000 said, your GetString() returns a const char* i.e. one you can't change.
The data member is non-const, so you can change it.
But that code looks rather unsafe. You don't show the code for your constructors, but is there always going to be enough storage for the string being read by operator>>?
As kevinkjt2000 said, your GetString() returns a const char* i.e. one you can't change.
The data member is non-const, so you can change it.
Clear now as you say it. My head got a bit thick from too much code today....
But that code looks rather unsafe. You don't show the code for your constructors, but is there always going to be enough storage for the string being read by operator>>?
That code was just a first introduction to streams and overloading in general. I guess details such as you mention will follow further on in the chapter.