2010年6月25日星期五

printf function sequence

In printf function, the sequence of calculating is from right to left.

Example:

#include
void main()
{
int a=5,b=2;
printf("%d %d\n",b=a+1,a=a+1);
}

output =>> 7 6
NOT 6 6


a=a+1 // 6
b=a+1// 7
then printf

没有评论:

发表评论