A C program selects and updates two integer readings using the following local variables. All variables remain alive throughout the code.
int low = 12; int high = 27; int *p = &(low); int *q = &(high); int **slot = &(p);
The program then executes these statements in order:
*slot = q; **slot += 5; q = &(low); *q += **slot;
Find the final values of low and high. Enter each as an exact integer; the readings have no physical units.
Unlock full course notes by signing up
Address after moving a double pointer backward
A program declares double temps[10]; and the array begins at byte address 5000, with sizeof(double) equal to 8 bytes. The program then runs double *p = &temps[7]; followed by p -= 2;. What byte address, in decimal, does p hold afterward? Give a whole number.
True statements about an array and a pointer to it
On a 64-bit system where int is 4 bytes and every pointer is 8 bytes, a function declares int arr[4]; and int *p = arr;. Which of the following statements are true? Select all that apply.
What does the increment change?
A C programmer tests two expressions with the same initial data. Each block executes independently, with a fresh array and pointer. Fill in the exact integer values after each block finishes.
First block:
After the first block, saved is ________ and the integer obtained by evaluating *p is ________.
Tracing a two-pointer loop over an array
The following C fragment runs on a system where int is 4 bytes. After the loop ends, give the final element at index 0, the final element at index 3, the final element at index 4, and the value of the expression q - p as a whole number of elements.