Hello,
I've programmed in Java and C for quite some time, but I'm now trying to learn C++. A few questions have come up, which I'd appreciate help with.
(1) In Java, it's common for a constructor to look like this:
In other words, the this keyword is used to differentiate between the parameters to the constructor, and the members of the class. Is there a way to do this C++? (With *this or something?) Or is this just not commonly done, and instead the parameters are given different names to the member variables?Code:public MyConstructor(int x, char c) { this.x = x; this.c = c; }
(2) C has headers such as <time.h>, <stdlib.h> etc. I can use these in C++, right? So what's the deal with <ctime>, <cstdlib>, and so forth? Is there a difference between the two styles?
(3) Is there such a thing as an ANSI-C++? I'm learning C++ from an old book (early 90s) - is this a problem? Is there a standardised version of C++ that only newer books would cover?
Thanks for all your help,
Justin