What is the output of the program?
#include
#include
using namespace std;
struct Person {
int age;
};
class First
{
Person *person;
public:
First() {person = new Person;
person?>age = 20;
}
void Print(){
cout << person?>age;
}
};
int main()
{
First t[2];
for (int i=0; i<2; i++)
t[i].Print();
}
Currently there are no comments in this discussion, be the first to comment!