, et derrière le ;, sauf en fin de ligne:
void example_foo(struct s_acu *acu)
{
int i;
for (i = 0; i < 255; ++i)
{
int j;
j = i + 2;
example_sum(acu, j);
}
}
str = xmalloc(sizeof (char) * 256);
exit(0);
Ceci concerne for etc. mais aussi sizeof.
return ne sera pas suivi de parenthèses.
return 1;
return str;
return;
Pour les autres mots-clefs sans argument, il ne faut pas d'espace avant le point-virgule:
break;
continue;
...
* porte toujours sur la variable (ou
fonction), et jamais sur le type:
char *cp; => Correct
char* cp; => Incorrect
char c; struct s_toto *example;
int titi = strlen("toto"); => Incorrect
char c = (str++, *str); => Incorrect
unsigned int i, j; => Incorrect
unsigned int *toto = &titi; => Correct
unsigned int foo = 1; => Correct
static int bar = -1; => Correct
unsigned int baz; => Correct
var1 = var2
var1 += var2
var1 *= var2
*cp
&cp
-n
if (a % 10)
return a;
return str ? str : DEFAULT_STRING;
#if et #ifdef indentent d'un caractère les
directives cpp qui suivent. Les #else et #endif marquent
les conditions dont ils sont issus.
#ifndef DEV_BSIZE
# ifdef BSIZE
# define DEV_BSIZE BSIZE
# else /* !BSIZE */
# define DEV_BSIZE 4096
# endif /* !BSIZE */
#endif /* !DEV_BSIZE */