home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C Programming Starter Kit 2.0
/
SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso
/
tyc
/
list12_5.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-16
|
461b
|
23 lines
/* Demonstrates local variables within blocks. */
#include <stdio.h>
main()
{
/* Define a variable local to main(). */
int count = 0;
printf("\nOutside the block, count = %d", count);
/* Start a block. */
{
/* Define a variable local to the block. */
int count = 999;
printf("\nWithin the block, count = %d", count);
}
printf("\nOutside the block again, count = %d", count);
}