如何判断静态局部变量是否被赋初值
#include <stdio.h>#include <stdlib.h> void TestLocal(int n){ static int nTest2 = n; printf("%p:",&nTest2); printf("%d\r\n",nTest2); (&nTest2)[1] = 0; nTest2++;} int main(){ TestLocal(10); TestLocal(20); TestLocal(30); system("pause"); return 0;}
本文地址:百科问答频道 https://www.neebe.cn/wenda/931319_4.html,易企推百科一个免费的知识分享平台,本站部分文章来网络分享,本着互联网分享的精神,如有涉及到您的权益,请联系我们删除,谢谢!