Question: C++ 1. ptr1=compile(prog, ptr1, false); 2. ptr1=compile(*ptr1, ptr1, ptr1==nullptr); 3. ptr2=compile(prog, ptr1, prog->c == 4); 4. ptr2=compile(prog.c, ptr1, ptr1 != ptr2); 5. ptr2=compile(*ptr2,ptr1, ptr1 !=

C++

C++ 1. ptr1=compile(prog, ptr1, false); 2. ptr1=compile(*ptr1, ptr1, ptr1==nullptr); 3. ptr2=compile(prog, ptr1,

1. ptr1=compile(prog, ptr1, false);

2. ptr1=compile(*ptr1, ptr1, ptr1==nullptr);

3. ptr2=compile(prog, ptr1, prog->c == 4);

4. ptr2=compile(prog.c, ptr1, ptr1 != ptr2);

5. ptr2=compile(*ptr2,ptr1, ptr1 != ptr2);

6. ptr2 = compile(prog, ptr2, prog.c == 4);

7. ptr1 = ptr2;

8. *ptr1 = *ptr2;

9. &prog=ptr2;

10. ptr1 = *prog;

11. ptr1=&prog;

12. ptr2->c=372;

13. ptr1[ ptr2->c]=ptr2->c;

14. ptr1 = allP;

15 ptr2 = *allP;

16 allP[ 0]=ptr2;

17 allP[ 1]=&prog;

18 allP[ allP[ 1]->c]->c=9;

19 ptr2 = allP+4;

20 allP[ 0]=compile(*ptr1, allP[ 1 ], ptr1==ptr2);

Given the following: class Cpp { public: intc; }; and, given the following declarations Cpp* compile(Cpp, Cpp*, bool); Cpp prog, *ptr1, *ptr2, *allP[2]; Note that compile is a function. State whether each set of code or statement is v for valid or i for invalid

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!