
HelloClass::HelloClass(string& istring) { str = istring; } HelloClass::HelloClass() { str = "default string"; } You can set up multiple constructors as above (this is not the best way to do it). Then to print the string, you may want to create a friend function so that you can do something like: HelloClass hw("Hello, World!"); cout << hw << endl; This should be in one of your books. Let the constructor assign the the string. That does not eliminate the desire for setting a message, but you can also use some overloading such that: hw = "New Value"; For the HelloClass, using a pointer is probably not altogether useful. But, you also need to be aware of some subtle performance issues. But, at this stage, try to concentrate on setting up constructors with optional arguments and default values. Without complexity, look at setting up things like copy constructors: HelloClass::HelloClass(HelloClass &s) { str = s.str; } Assignment operator, and possibly concatenation. You wil be reinventing the wheel a bit, but you will also be learning. Don't worry too much about efficiency. Once you are experienced in the language, then you can be more efficient. In any kind of computer programming, the most important issue is to accomplish the task at hand. But, I always try to make my code readable and maintainable. One reason is that I have had to maintain some horrible code (eg. the sources for YACC and LEX). The other reason is that I want those who come behind me not to curse me. In this industry there are always cases where when looking for a job, someone who knows you may be on the hiring side. But even for your own personal code, you might put it down and not look at it for a while.