Question: CPSC2380-01 Spring 2020 6. (20 Points) Given the following program, (a) trace the output by drawing the memory model as the program runs. (b) What

 CPSC2380-01 Spring 2020 6. (20 Points) Given the following program, (a)
trace the output by drawing the memory model as the program runs.
(b) What does printf("%d ", ptr2 - ptri) print in C/C++? #include
using namespace std; int main() {1.5, 1.0, 3.5); float arr [3] =

CPSC2380-01 Spring 2020 6. (20 Points) Given the following program, (a) trace the output by drawing the memory model as the program runs. (b) What does printf("%d ", ptr2 - ptri) print in C/C++? #include using namespace std; int main() {1.5, 1.0, 3.5); float arr [3] = float *ptrl; float *ptr2; ptrl - &arr [0]; ptr2 = ptrl + 2; printf("X X X ", arr, ptri, system("PAUSE"); return 0; output 3AFDCO 3AFDCO 3AFDC8 Press any key to continue. (ANSWER] SADC gested Sites Imported From IE G O SoloLearn: Learn to... Angle (Degrees) an. ES CKGS USA - Passpo... Cygwia 7. (10 Points) Given the following program, #include using namespace std; #include int main() float arr (5) - {12.5, 10.0, 13.5, 90.5, 0.5); float *ptrl; float *ptr2; ptrl - &arr [0]; ptr2 - ptrl + 3; printf("%X X X ", arr, ptri, ptr2); printf("%d ", ptr2 - ptrl); printf("%d ", (char*)ptr2 - (char*)ptrl); system("PAUSE"); return 0; __(T/F) arr is equivalent to &arr[0] (T/F) ptr2 is equivalent to &arr[3] (T/F) number of elements between ptr2 and ptr 1 is 3 (T/F) number of bytes between ptr2 and ptri is 3 (T/F) This program will cause a compiler error + SPITZUH2DX?projector=1&message Partid=0.1 Suggested Sites DIDUUR Imported From IE G O SoloLearn: Learn to... 17) number or elements between purz ana pri 153 Angle (Degrees) an. CKGS USA - Passpo. Cygwi (T/F) number of bytes between ptr2 and ptri is 3 (T/F) This program will cause a compiler error 8. (10 Points) What will be the output of the following code? #include using namespace std; void main() char *s = "hello"; char *p - S; cout program? int xyz (int *ptr) *ptr = 30; int main() int y - 20; xyz (by); printf("%d", y); return 0; +

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!