The definition of the class AA got some error. Can anyone let me know whats the error in Class AA? The output should be same as in comments below..
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
class AA {
int x;
public :
int getX() {
return x;
}
};
int main () {
cout << AA :: getX() << endl; // 0
AA* a = new AA[100];
cout << AA :: getX() << endl; //100
delete [] a;
cout << AA:: getX() << endl; // 0