#include <stdio.h>#include <stdlib.h>int f(int a){ int b=0; static int c=0; b++; c++; return (a+b+c);}
int main(int argc, char *argv[]){ int i; for (i=0;i<3;i++){ printf("%5d",f(2)); } system("PAUSE"); return 0;}½á¹ûÊä³ö 4 5 6
Èç¹û°Ñint bǰ¼ÓÉÏ staticÔò½á¹ûÊä³ö 4 6 8
ÔÒòÊÇ c ÊÇÈ«¾ÖµÄ±äÁ¿£¬ÔÚÄͼºÃʹ¡£