home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.disi.unige.it
/
2015-02-11.ftp.disi.unige.it.tar
/
ftp.disi.unige.it
/
pub
/
.person
/
CataniaB
/
teach-act
/
esempi
/
Scoping
/
esempio3.c
< prev
Wrap
C/C++ Source or Header
|
1997-04-01
|
381b
|
35 lines
#include<stdio.h>
/* Dichiarazioni nei blocchi */
void p1(void)
{
int x=6;
if (x>0)
{
int x=-2; /* dichiarazione interna ad un blocco {...}*/
if (x<0) printf("%d",x);
}
}
void p2(void)
{
int y=4;
int x=0;
printf(" %d",x);
{ int x=y;
printf(" %d",x);
}
}
void main(void)
{
p1();
/* stampa -2 */
p2();
/* stampa 0 4 */
}