#include #include int G = 1; int* P; void func(int * agrl int arg2) {static int
ID: 3824730 • Letter: #
Question
#include #include int G = 1; int* P; void func(int * agrl int arg2) {static int S = 10; int A[10] = {arg2}; printf("S: %4d, B: %4d, C: %4d ", S, *argl, A[0]); S = arg2;} int main () {int M; P = malloc (10* sizeof (int)); M = 100; P[0] = 200; func(&M;, P[0]); func(P, G); What does the program print? Circle (below) all variables for which memory for the variable itself is allocated at compile time. G P S A M Circle (below) all variables for which memory for the variable itself is allocated on the stack at runtime. G P S A MExplanation / Answer
Global and static variables = BSS = program startup/termination
Local variables = stack= function entry/return
Dynamic memory = heap= malloc()/free()
2) P(dynamic memory allocation)
3)A(local variable inside function)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.