What is the size of an activation record for the function f()? How did you find out?

#include <stdio.h>
 
int K = 1024;
 
main(int argc, char *argv[])
{
     int n;
     int f() ;
     
     if (argc != 2) exit(-1);
     n = atoi(argv[1]);
     printf("Address of:\n K=%x \n main=%x \n argc=%x \n argv=%x \n");
     printf ("n=%x \n f=%x \n printf=%x \n", &K, &main, &argc, &argv, &n, &f);
     f(n) ;
}
 
int f(int n)
{ 
     int *m;
     static int s;
 
     m = (int*)malloc(K*sizeof(int));
     printf("f(%d) starts \n n=%x \n m=%x \n s=%x \n *m=%x \n", n, &n, &m, &s, m);
     
     if(n>0) f(n-1);
     
     printf("f(%d) returns\n", n);
     return;
}

Can any one explain that?

>What is the size of an activation record for the function f()?
It depends on the compiler and there's really no reason for you to care in client code.

>How did you find out?
Experience and knowledge of the C standard.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.