September 2001
Beginner
970 pages
23h 20m
English
| 1: | What will this program print?
#include <stdio.h>
int main(void)
{
int ref[] = {8, 4, 0, 2};
int *ptr;
int index;
for (index = 0, ptr = ref; index < 4; index++, ptr++)
printf("%d %d\n", ref[index], *ptr);
return 0;
}
|
| 2: | In question 1, how many elements does ref have? |
| 3: | In question 1, ref is the address of what? What about ref + 1? What does ++ref point to? |
| 4: | What is the value of *ptr and of *(ptr + 2) in each case?
|
| 5: | What is the value of **ptr and of **(ptr + 1) in each case?
|
| 6: | Suppose ... |
Read now
Unlock full access