The stack call process of the function that adds two numbers

#include<stdio.h>
int add(int x,int y)
{
int z = 0;
z=x+y;
return z;
}
int main()
{
int a=10;
int b=20;
printf("%d\n",add(a,b));
return 0;

}

The stack of the main function main() is shown in the figure


The stack of the add function is shown in Figure 2.

Guess you like

Origin blog.csdn.net/lxp_mujinhuakai/article/details/54407449