More C fun ... - (nf)

grunwald at uiuccsb.UUCP grunwald at uiuccsb.UUCP
Fri Dec 9 19:30:50 AEST 1983


#R:ihtnt:-201000:uiuccsb:9000008:000:381
uiuccsb!grunwald    Dec  9 00:04:00 1983

This makes sense.
The function decleration is defined as

function name (parameters)
		decleration statements
		compound-statement

I thing that each compound-statement introduces a new scope. Thus, this is
equivilent to complaining about the following return "6":

woof(j)
int j;
{
	int j = 3;
	{
		int j = 6;
		return(j);
	}
	return(j);
}
main()
{
	printf(" = %d\n", woof(5));
}



More information about the Comp.lang.c mailing list