Learn How to Program in Cby Dr. Kristin Switala
|
|
Answers to Review: Pointers (c)
General Questions
1. the address of a variable
2. int *point = NULL;
3. to give the value of the variable, instead of the value of the pointer
White Box Testing
1. two errors:
- in line 5, add a * before point: int *point = NULL;
- in line 6, add an & before shoes: point = &shoes
2. two errors:
- in line 7, the first format specifier should be %d instead of %p: printf("\n%d\tNumber's Value
- in line 8, the last variable should be &point
3. two errors:
- in line 5, the variable should be long *point instead of int *point
- in line 10, change pont to point
4. two errors:
- line 8 should be *point = eggs * 4;
- in line 9, the variable should be eggs instead of point
|
|