braces (was: Latest indent request)

Dave Decot decot at hpisod2.HP.COM
Wed Dec 7 00:34:44 AEST 1988


> NO, THIS IS HOW YOU DO IT.  It's the only way :-) !
> 
> main (argc, argv)
> int argc;
> char *argv[];
> {
> 	int foo;
> 	char bar;
> 
> 	if (expr)
> 	{
> 		while (cond)
> 		{
> 		}
> 	}
> }

So close!  However, this really should be:

main (argc, argv)
int argc;
char *argv[];
{
    int foo;
    char bar;

	if (expr)
	{
		while (cond)
		{
		}
	}
}

Dave Decot
hpda!decot



More information about the Comp.unix.wizards mailing list