Actions

EmSys

CCoding Style - Indent to show structure

From EdWiki

Indent to show structure

A consistent indentation style is necessary to make a program’s structure self-evident.

for(n++;n<100;field[n++]=‘\0);
*i=‘\0; return(‘\n’);

Reformatting improves it somewhat:

for( n++; n < 100; field[n++] = ‘\0)
	;
*i = ‘\0;
return (‘\n’);

Even better is to put the assignment in the body and separate the increment, so the loop takes a conventional form and is thus easier to grasp:

for( n++; n < 100; n++)
    field[n] = ‘\0;
*i = ‘\0;
return ‘\n’;