I cant understand why I have redefinition trying to run this example. Can anyone tell me?
using namespace std;
class Base {
protected: int *value;
public: Base() {
value = new int,
*value = 1;
};
Base(int &n) {
value = new int[n];
}
};
int main() {
int x=2;
Base zm;
Base(x);
system("Pause");
}
How about this?: