I have never really done much programming in C++, and while Kuci informs me that it is a terrible hideous language, it seems like it would be a good idea for me to learn it at some point. I'm guessing that there is no equivalent to the K&R C book for C++, but can anyone recommend a good reference? If it comes with a CD or has any sort of "learn in x time period" then I'm assuming it's crap. (Is that a safe assumption?)
I also have a few questions about it:
1. What precisely are destructors? Does C++ call them when you free an object?
2. What exactly happens when you use the new operator? Does it somehow recursively malloc everything an object needs? Is it a Good Thing or a Bad Thing? Does it work the same way it works in Java?
3. Why does cout overload the left shift operator? Is it just too cool to be a method? Where else are operators overloaded in bizarre and idiosyncratic ways?
I apologize if these are stupid questions, but #3 convinced me that I should assume nothing. Seriously though, as far as I can tell it has literally nothing to do with bit shifting.
Thanks.
I also have a few questions about it:
1. What precisely are destructors? Does C++ call them when you free an object?
2. What exactly happens when you use the new operator? Does it somehow recursively malloc everything an object needs? Is it a Good Thing or a Bad Thing? Does it work the same way it works in Java?
3. Why does cout overload the left shift operator? Is it just too cool to be a method? Where else are operators overloaded in bizarre and idiosyncratic ways?
I apologize if these are stupid questions, but #3 convinced me that I should assume nothing. Seriously though, as far as I can tell it has literally nothing to do with bit shifting.
Thanks.
Comment