I got some other outputs.. when line 6 isn't commented i got 3 1 2 3, i m using turbo c++ compiler..
On Fri, Dec 6, 2013 at 8:17 AM, pawan yadav <[email protected]>wrote: > Hi All, > > I'm not able to get output of following c program : > > #include<stdio.h> > main() > { > int a[] ={ 1,2,3,4,5,6,7}; > char c[] = {'a','x','h','o','k'}; > // printf("%u %u\n", &a[3], &a[0]); line 6 > printf("%d %d %d %d \n", (&a[3]-&a[0])); > } > > If line 6 is commented, output : > > 3 1562814827 1869117537 0 > > Confusion : why is there 4 output? "(&a[3]-&a[0])" should give only one. > > if line 6 is not commented, output : > > 1554221244 1554221232 > 3 1554221232 1309214001 64 > > > > Can anybody please explain why/how these outputs are coming? > > Thanks, > Pawan. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
