例子:
struct stu{ char name[20]; int age; char* addr; }; int inCall (char c,int n,char* hi, stu stu1){ int locInt = 0x1234; char* locStr = "here i am"; printf("%c\t0x%x\t%s\t0x%x\t%s\n",c,n,hi,locInt,locStr); printf("%s\t%d\t%s\n",stu1.addr,stu1.age,stu1.name); return 20; } void main() { stu stu1; memset(&stu1,0,sizeof(stu1)); memcpy_s(stu1.name,strlen("ZhangSan"),"ZhangSan",strlen("ZhangSan")); stu1.age = 0x30; stu1.addr = "Beijing"; char* hi = "how are you?"; inCall(‘A‘,0x70,hi,stu1); getchar(); }
- main函数的执行过程:
栈空间:
2.inCall函数的执行过程和栈空间:
时间: 2024-10-25 19:20:06