标签:
#include <stdio.h> int func(void) { static int counter = 1; return ++counter; } int main() { int anwser; anwser = func() - func()*func(); printf("%d\n",anwser); getchar(); return 0; }
在func()函数内,我们定义了静态变量counter,初始化值为1.
标签:
原文地址:http://blog.csdn.net/lolita0917/article/details/45726529