Re: Point de sequencement dans un appel de function
[ Nouvelle discussion
| Répondre au groupe
|
fr.comp.lang.c ]
Sujet: Re: Point de sequencement dans un appel de function
De: c_cand...@free.fr (candide)
Groupes: fr.comp.lang.c
Organisation: Guest of ProXad - France
Date: 28. Apr 2008, 14:34:55
References: 1
|
candide a écrit :
>
> Soit le code :
>
> ----------------------
> #include <stdio.h>
>
> int main(void)
> {
> int i = 10;
>
> printf("%d %d \n", i++,i);
> return 0;
> }
> ----------------------
>
> qui, à la compilation, m'affiche ceci :
>
> ----------------------
> candide@candide-desktop:~$ gcc -W -Wall -pedantic -o x test.c
> test.c: In function «main":
> test.c:7: attention : operation on «i" may be undefined
> ----------------------
>
Une variante qui elle passe sans crier :
----------------------
#include <stdio.h>
int main(void)
{
int i = 10;
printf("%d \n", 0*i++ + i);
return 0;
}
----------------------
candide@candide-desktop:~$ gcc -W -Wall -pedantic -o x test.c
candide@candide-desktop:~$ ./x
11

|
 cette fonctionnalité est reservée aux membres ayant une session active !
|