Steven T. Hatton wrote:
This looks a lot like the MyClass.toString() of Java. I'm not sure I have the best books for learning C++. The Ellis and Stroustrup book seems to be about 50% apology for doing things Stroustrup would rather not have, but for the desire to cooperate with existing C program(mer)s. It's interesting, but certainly doesn't present the language as deftly as K&R does C. K&R is one very well written book. I have Horstmann's 1991 edition. It's probably dated. Pohl's book is likewise a decade old. I'm sure they are all worth reading, but they probably don't provide the best treatment of recent advances, and imporved libraries, etc. They will have to do for now, however.
You might try something like Deitel & Deitel given that you're newer to C++ but already know java. Stroustrup's C++ book is good but a little harder. Ellis and Stroustrup is older, very definitive and very difficult to read. I use it only when I need to know how something really obscure works. -- JDL