Created
May 26, 2017 21:46
-
-
Save evanlimanto/8cf6d652e6f2293c0e6baf25cd819be9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MT1-1: Potpourri – Good for the beginning... (8 points) | |
a. **True/False:** | |
i. The compiler turns C code into instructions ready to be run by a processor **True** **False** | |
ii. The instruction addiu $t0 $t1 100000 is a TAL instruction **True** **False** | |
iii. The linker computes the offset of all branch instructions **True** **False** | |
b. **Memory Management** | |
int global = 0; | |
int* func() { | |
int* arr = malloc(10 * sizeof(int)); | |
return arr; | |
} | |
int main() { | |
char* str = "hello world"; | |
char str2[100] = "cs61c"; | |
int* a = func(); | |
return 0; | |
} | |
In what part of memory are each of the following values stored? | |
*str: str2[0]: | |
a: arr: | |
arr[0]: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment