home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C Programming Starter Kit 2.0
/
SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso
/
tyc
/
list12_4.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-16
|
376b
|
22 lines
/* Demonstrates automatic and static local variables. */
#include <stdio.h>
void func1(void);
main()
{
int count;
for (count = 0; count < 20; count++)
{
printf("At iteration %d: ", count);
func1();
}
}
void func1(void)
{
static int x = 0;
int y = 0;
printf("x = %d, y = %d\n", x++, y++);
}