代码如下
全局变量和static对多线程来讲是不安全的
#include <stdio.h> int *f(void); void g(void); int main(int argc,char const *argv[]) { int *p=f(); printf("*p=%d\n",*p); g(); p=f(); printf("*p=%d\n",*p); g(); printf("*p=%d\n",*p); return 0; } int *f(void) { int i=12; int *m = &i; //printf("*p=%p\n",m); return m; } void g(void) { int k=24; printf("k=%d\n",k); //printf("&k=%p\n",&k); }
标签:return,P108,int,void,地址,本地,printf From: https://www.cnblogs.com/huskyWuWuWu/p/16979666.html