[LCP]query regarding pointers in C

sowmya.k sowmi99 at yahoo.com
Thu Apr 15 21:17:02 UTC 2004


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.linux.org.au/pipermail/linuxcprogramming/attachments/20040415/2c9aae32/attachment.htm 


More information about the linuxCprogramming mailing list