Question: *This is the problem regards on the C programming. Review what you have learned of Pointer and array. Consider the array and pointer created by

 *This is the problem regards on the C programming. Review what

*This is the problem regards on the C programming. Review what you have learned of Pointer and array. Consider the array and pointer created by the following lines of code: int* ptr; int arr[] = ptr = arr; {3,6,9,12,15,18,21,24,27}; After running this code, the memory stack can be represented by the following table. Address OxA00 OxA08 OxA10 OxA14 OxA18 OxA1C OXA20 OXA24 OXA28 OxA2C OXA30 Value OxA10 OxA10 3 6 9 12 15 18 21 24 27 Name ptr arr C treats stack arrays and pointers a little differently. This exercise is about the true pointer variable ptr, but it is convenient to initialize ptr with the array called arr. For each of the C code fragments below, determine if it is a valid expression. If it is, what is the data type of the result (e.g., int, int*, ...) and what is the value of the expression? (Remember, if the expression is a pointer, the value is an address.) If it is not, why not? Feel free to put any of these fragments into a small C program to test the result. Note that the memory locations in the table are arbitrary. If you try to run the code, you will get different memory locations. (a) ptr (b) ptr [3] (C) 3+ptr (d) 3*ptr (e) 3**ptr (f) *(3+ptr) (g) *ptr+3 (h) (ptr+3)* (i) & (ptr+3) (i) (ptr+3)& (k) 3 [ptr] (1) & (ptr [3]) (m) ptr [3] [3] (n) (ptr+3) [3] (0) *ptr (p) ptr* (q) &ptr (c) ptr&

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!