CPA practice question 24 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 30 Correct answer
D: It prints: John 30John 30
Correct Answer:
C. It prints: John 30
Scroll to Top