1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Name:
cs202 login:
Quiz 6 - Bit Operations and Program Memory
1) Program Memory Organization
Given a complete C program, tell where each variable is stored in program
memory. Example:
Given:
#include <stdio.h>
char c = 'a';
int main(int argc, char *argv[])
{
int x = 20;
int a[20];
int *b = malloc(10 * sizeof(int));
}
Questions:
1.1) Where is x stored?
1.2) Where is argc stored?
1.3) Where is b stored?
1.4) Where is b[2] stored?
1.5) Where is a[1] stored?
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX