CPA practice question 12 of 30

What happens when you attempt to compile and run the following code? #include #include using namespace std; struct Person { string name; int age; }; class First { Person *person; public: First() {person = new Person; person?>name = "John"; person?>age = 30; } void Print(){ cout

Full set: 220 questions
Answer options
A: It prints: 30
B: It prints: John
C: It prints: John 31
D: It prints: John 30John 30 Correct answer
Correct Answer:
D. It prints: John 30John 30
Scroll to Top