以下情况会出现野指针。
#include<stdio.h>
#include<stdlib.h>
int* test()
{
int a=10;
return &a;
}
int main()
{
int *p=test();
*p=20
system(“pause”);
return 0;
}
c语言sizeof和数组
最新推荐文章于 2024-08-14 11:22:43 发布
以下情况会出现野指针。
#include<stdio.h>
#include<stdlib.h>
int* test()
{
int a=10;
return &a;
}
int main()
{
int *p=test();
*p=20
system(“pause”);
return 0;
}