C++ Institute CPA-21-02 Question Answer
What happens when you attempt to compile and run the following code?
#include
using namespace std;
void set(struct person*);
struct person
{
int age;
};
int main()
{
struct person e = {18};
set(&e);
cout<< e.age;
return 0;
}
void set(struct person *p)
{
p?>age = p?>age + 1;
}
C++ Institute CPA-21-02 Summary
- Vendor: C++ Institute
- Product: CPA-21-02
- Update on: Aug 2, 2025
- Questions: 257