M
marsarden
--------pq.c--------
#include <stdio.h>
void main()
{
int a=2,*p,*q;
p=&a;q=&a;
printf("%d %d\n",*p++,*(q++));
printf("%d\n",a);
p=&a;q=&a;
printf("%d %d\n",*p,(*q)++);
}
-----------------------------------------
in gcc it output:
2 2
2
3 2
in vc6 it output:
2 2
2
2 2
anyone can tell me how the printf works?
#include <stdio.h>
void main()
{
int a=2,*p,*q;
p=&a;q=&a;
printf("%d %d\n",*p++,*(q++));
printf("%d\n",a);
p=&a;q=&a;
printf("%d %d\n",*p,(*q)++);
}
-----------------------------------------
in gcc it output:
2 2
2
3 2
in vc6 it output:
2 2
2
2 2
anyone can tell me how the printf works?