question about printf

Alexandre Oliva oliva@dcc.unicamp.br
Wed Nov 18 11:31:00 GMT 1998


On Nov 18, 1998, Kent B Mein <mein@cs.umn.edu> wrote:

> Not sure if this is the place to talk about it or not.

it is not.  It's a C FAQ.

> printf("%c %c %c %c\n",getchar(),getchar(),getchar(),getchar());

> Preforms the getchar's backwards.

The order of evaluation of function arguments is not defined.

> The fix is of course to store the getchar's in var's before
> printing them out.

Yes.

-- 
Alexandre Oliva  http://www.dcc.unicamp.br/~oliva  aoliva@{acm.org}
oliva@{dcc.unicamp.br,gnu.org,egcs.cygnus.com,samba.org.au}
Universidade Estadual de Campinas, SP, Brasil




More information about the Gcc-bugs mailing list