Question: Hi, i'm learning about memory allocation in the c language. I missed the class where this worksheet was given so i'm wondering if you can
Hi, i'm learning about memory allocation in the c language. I missed the class where this worksheet was given so i'm wondering if you can help with explanations
1. Each time a variable is declared or memory is otherwise allocated, it is important to understand how much memory is allocated, where it will be allocated and whenl be de-allocated. Complete the table below. (Note: some of the programs allocate more than one block of memory.) Code Fragment int main) Space? Where? De-allocated when sizeof(int) stack frame for main int i; when program ends int fun) float i; int main) [ funO; int fun(char i) { int main) [ fun('a') int main() char i[10]"hello"; int main char *i; int main) [ int *i; int main) char *i"hello"; int fun (int i int main) [ int i[5]4,5,2,5,1); fun(i); int main) int *i; imalloc (sizeof (int)); void fun (int i) imalloc (sizeof (int)*T) int main) int *i; fun(&i); free(i)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
