runtime error: load of null pointer of type 'const int'
要求返回的是int*
解决方案
1.指针使用malloc分配空间
用 int * p = (int * )malloc(sizeof(int)*2);取代 int a[2]={0};
2.使用static
用 static int a[2]={0}; 取代 int a[2]={0};
要求返回的是int*
用 int * p = (int * )malloc(sizeof(int)*2);取代 int a[2]={0};
用 static int a[2]={0}; 取代 int a[2]={0};
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。