[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[LCP]query regarding pointers in C



pls tell me how these 2 pgms work
 
1. #include<stdio.h>
    main()
   {
     int a=555,*ptr=&a,b=*ptr;
     printf("%d %d %d",++a,--b,(*ptr)++);
}
 
for this the output is 557 554 555
 
2. #include<stdio.h>
    main()
   {
     int a=555,*ptr=&a,b=*ptr;
     printf("%d %d %d",++a,--b,*ptr++);
}
 
for this i got the output as 556 554 555

Could any one pls explain me the reson behind this output

Thanking you,

Sowmya


Do you Yahoo!?
Yahoo! Tax Center - File online by April 15th