Consider the following C program: #include #include int g…
Consider the following C program: #include #include int g1 = 42; int g2; static int sg = 7; void foo(int n) { int local = 5; static int sLocal = 100; int *p = (int*)malloc(n * sizeof(int)); p[0] = g1 + local; printf(“%d\n”, p[0]); free(p); } int main(int argc, char *argv[]) { int x = 10; foo(4); return 0; } Where are the variables x, local, and parameter n stored?
Read Details