摘要: static 变量 头文件中的static会在引用该头文件的cpp中分别生成副本//H.h#ifndef _H_H_#define _H_H_static int a = 0;#endif//Ex_2.c#include "H.h"void fun_ex2 (){ a++; printf ("%d", a);//这时会打印1}//Ex_3#include "H.h"void fun_ex3 (){ printf ("%d", a);//这时打印的依然是0,即便先被Ex_2中的fun_ex2()函数修改过,因为他们 阅读全文
posted @ 2013-10-18 11:44 懒猫欣 阅读(150) 评论(0) 推荐(0)