C examples for Function:static
Illustrating Static and Automatic Variables
#include <stdio.h> void auto_static (void) { int autoVar = 1; static int staticVar = 1; printf ("automatic = %i, static = %i\n", autoVar, staticVar); ++autoVar;/*from w w w .j av a 2s. c o m*/ ++staticVar; } int main (void){ for (int i = 0; i < 5; ++i) auto_static (); return 0; }