What happens when you attempt to compile and run the following code?
#include
using namespace std;
class Test {
float i,j;
};
class Add {
public:
int x,y;
Add (int a=3, int b=3) { x=a; y=b; }
int result() { return x+y;}
};
int main () {
Test test;
Add * padd;
padd = &test;
cout << padd?>result();
return 0;
}
Suggested Answer: C
Get Premium CPA-21-02 Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
1 comments · newest first
VE
Vesta
1 day ago
I think there's a compilation error because `padd` is a pointer to `Add`, but it's being assigned an instance of `Test`.