Question: Using C programming and UNIX/Linux terminal. 3. Suppose a C program contains the definition of an array of unsigned short integers. The array is defined
Using C programming and UNIX/Linux terminal.

3. Suppose a C program contains the definition of an array of unsigned short integers. The array is defined as follows: unsigned short us[6] = { 2, 4, 6, 8, 10, 12 }; Suppose that the following C statement printf("%zu %p ", sizeof( unsigned short ), us ); , also in the program, produces 2 0x7fff5d11c866 (a) What would the following subsequent statement print? printf("%p ", &us [3] ); (b) What would the following subsequent statement print? printf("%p ", &us [3] + 2); (c) What would the following subsequent statement print? printf("%p ", &us [3] + us[0] ); (d) Suppose that in this program there is also defined a variable ptr of type unsigned short *. What will be printed as a result of the following subsequent statement combination? ptr = &us [1] ; printf("%hu ", *++ptr)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
