f



printf("%d,%d,%d", a, a++, a++)

int main(void)
{
	int a = 3;
	printf("%d, %d, %d", a, a++, a++);
}

with Gcc, the output is "5 4 3", I just confused.
0
Xiaofeng
12/14/2004 2:54:31 AM
comp.lang.c 30657 articles. 5 followers. spinoza1111 (3246) is leader. Post Follow

3 Replies
746 Views

Similar Articles

[PageSpeed] 55


Xiaofeng Ye wrote:
> int main(void)
> {
> 	int a = 3;
> 	printf("%d, %d, %d", a, a++, a++);
> }
> 
> with Gcc, the output is "5 4 3", I just confused.

Question 3.2 of the faq will be elucidating. See:
http://www.eskimo.com/~scs/C-faq/q3.2.html

-
Al Bowers
Tampa, Fl USA
mailto: xabowers@myrapidsys.com (remove the x to send email)
http://www.geocities.com/abowers822/

0
xabowers (231)
12/14/2004 3:22:25 AM
In article <cplkgg$17pq$1@mail.cn99.com> Xiaofeng Ye  <chnos@163.com> wrote:
>       printf("%d, %d, %d", a, a++, a++);
>with Gcc, the output is "5 4 3", I just confused.

See the comp.lang.c FAQ, section 3.
-- 
In-Real-Life: Chris Torek, Wind River Systems
Salt Lake City, UT, USA (40�39.22'N, 111�50.29'W)  +1 801 277 2603
email: forget about it   http://web.torek.net/torek/index.html
Reading email is like searching for food in the garbage, thanks to spammers.
0
nospam252 (1722)
12/14/2004 3:26:13 AM

Xiaofeng Ye wrote:
> int main(void)
> {
> 	int a = 3;
> 	printf("%d, %d, %d", a, a++, a++);
> }
> 
> with Gcc, the output is "5 4 3", I just confused.

Have you read C-FAQ ?
Read the section:
http://www.eskimo.com/~scs/C-faq/s3.html


0
raviuday (113)
12/14/2004 3:55:55 AM
Reply: