delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/21/18:01:40

Message-ID: <33ABA2A0.539A@sysnetway.com.br>
Date: Sat, 21 Jun 1997 18:45:04 +0900
From: Edevaldo <edevaldo AT sysnetway DOT com DOT br>
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Is this the normal behavior?

It is more a C question than a DJGPP related one, but ...
	When I execute this program:



#include <stdio.h>

int main( void)
{
        int i;

        for( i=0; i<4; printf( "%i %i\n", i, i++) );

        return 0;
};



	I was expecting it's output to be like

0 0
1 1
2 2
3 3

	But, it was

1 0
2 1
3 2
4 3

	Is this the normal behavior?
	In C the later arguments are evaluated first? The stack?


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019