CS 61C (Fall 2007) |
Quiz 5Five questions, submit as "quiz5". Due 2:45pm before lecture 9/10/2007. |
To be very clear, you should submit one and only one file template.txt
which contains your answers, by running submit quiz5
.
Any files not named template.txt
will be ignored, without exception!
For each of the following kinds of data, list all possible storage locations (zero, one or more may apply):
- The Stack
- The Heap
- Static Storage
- None of the above
1.
Temporary variables.
2.
Function arguments.
3.
A global variable.
4.
A linked list.
5.
Consider the following program.
char bar(int *p) {
int b;
return (&b < p) ? 't' : 'f';
}
char foo() {
int a;
return bar(&a);
}
What will foo()
return? Briefly explain your answer.