http://ideone.com/9Txzo U cannot use %d when trying to print address \dey dont fall in range...and iu have modified it...u can chk the output.. i think ull be able to interpret the results...lemme knw if u have any doubt...
On Sun, Jul 31, 2011 at 3:18 PM, Shubham Maheshwari <shubham....@gmail.com>wrote: > http://ideone.com/IZKyN > > could you plzz explain this to me ...!! > anyone ... > > On Sun, Jul 31, 2011 at 1:56 AM, Kamakshii Aggarwal <kamakshi...@gmail.com > > wrote: > >> @sanchit:no,not at all :) >> >> >> On Sun, Jul 31, 2011 at 1:55 AM, Sanchit Manchanda >> <sanchit...@gmail.com>wrote: >> >>> @kamakshi- sorry if you felt i was rude. :-\ >>> >>> >>> On Sun, Jul 31, 2011 at 1:53 AM, aditi garg >>> <aditi.garg.6...@gmail.com>wrote: >>> >>>> some garbage value >>>> >>>> >>>> On Sun, Jul 31, 2011 at 1:51 AM, gaurav gupta <grvgupta...@gmail.com>wrote: >>>> >>>>> then wat sud b the value of *(&a+1) since array is only defind for 5 >>>>> elements >>>>> >>>>> >>>>> On Sun, Jul 31, 2011 at 1:48 AM, Sanchit Manchanda < >>>>> sanchit...@gmail.com> wrote: >>>>> >>>>>> yes it will print the next address in memory after the last element. >>>>>> >>>>>> >>>>>> On Sun, Jul 31, 2011 at 1:46 AM, gaurav gupta >>>>>> <grvgupta...@gmail.com>wrote: >>>>>> >>>>>>> i understand much. thanx fr it. plz tell me if i hv to print &a+1 >>>>>>> then it sud print the next address after the last element >>>>>>> >>>>>>> >>>>>>> On Sun, Jul 31, 2011 at 1:40 AM, Sanchit Manchanda < >>>>>>> sanchit...@gmail.com> wrote: >>>>>>> >>>>>>>> @gaurav- &a takes you to the address 1st element of the array. >>>>>>>> &a+1 takes you to the next address after the last element. this mean >>>>>>>> if int is 4bits. then arrays of 5 int values is 20 bits. so *+1 *in >>>>>>>> &a+1 covers 20 bits in memory. similarly &a+2 covers next 20 bits. and >>>>>>>> so >>>>>>>> on. >>>>>>>> >>>>>>>> where as &(*(a+1)) points to 1st element,&(*(a+2)) points to 2nd >>>>>>>> element and so on. >>>>>>>> >>>>>>>> i hope this helps >>>>>>>> >>>>>>>> >>>>>>>> On Sun, Jul 31, 2011 at 1:35 AM, gaurav gupta < >>>>>>>> grvgupta...@gmail.com> wrote: >>>>>>>> >>>>>>>>> so u mean der is difference between a and a[0] >>>>>>>>> >>>>>>>>> >>>>>>>>> On Sun, Jul 31, 2011 at 1:30 AM, Kamakshii Aggarwal < >>>>>>>>> kamakshi...@gmail.com> wrote: >>>>>>>>> >>>>>>>>>> &a points to the array.so when u increment it by 1 it will get >>>>>>>>>> incremented by the size of array. >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On Sun, Jul 31, 2011 at 1:28 AM, gaurav gupta < >>>>>>>>>> grvgupta...@gmail.com> wrote: >>>>>>>>>> >>>>>>>>>>> &a+1 takes to the last element of the array bt is the logic >>>>>>>>>>> behind dis >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> On Sun, Jul 31, 2011 at 1:25 AM, Kamakshii Aggarwal < >>>>>>>>>>> kamakshi...@gmail.com> wrote: >>>>>>>>>>> >>>>>>>>>>>> &a+1 will point to the next array(i.e it will skip the whole >>>>>>>>>>>> array) >>>>>>>>>>>> where as &(a+1)will print address of element 2. >>>>>>>>>>>> >>>>>>>>>>>> On Sun, Jul 31, 2011 at 1:21 AM, Sanchit Manchanda < >>>>>>>>>>>> sanchit...@gmail.com> wrote: >>>>>>>>>>>> >>>>>>>>>>>>> Sorry my bad. I was wrong. >>>>>>>>>>>>> >>>>>>>>>>>>> On Sun, Jul 31, 2011 at 1:15 AM, gaurav gupta < >>>>>>>>>>>>> grvgupta...@gmail.com> wrote: >>>>>>>>>>>>> >>>>>>>>>>>>>> main() >>>>>>>>>>>>>> { >>>>>>>>>>>>>> int a[5]={1,2,3,4,5}; >>>>>>>>>>>>>> printf("%d%d",&a+1,&(a+1)); >>>>>>>>>>>>>> } >>>>>>>>>>>>>> plz explain me the difference in ans. >>>>>>>>>>>>>> thanx...... >>>>>>>>>>>>>> >>>>>>>>>>>>>> -- >>>>>>>>>>>>>> You received this message because you are subscribed to the >>>>>>>>>>>>>> Google Groups "Algorithm Geeks" group. >>>>>>>>>>>>>> To post to this group, send email to >>>>>>>>>>>>>> algogeeks@googlegroups.com. >>>>>>>>>>>>>> To unsubscribe from this group, send email to >>>>>>>>>>>>>> algogeeks+unsubscr...@googlegroups.com. >>>>>>>>>>>>>> For more options, visit this group at >>>>>>>>>>>>>> http://groups.google.com/group/algogeeks?hl=en. >>>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> -- >>>>>>>>>>>>> Sanchit Manchanda >>>>>>>>>>>>> COE(3rd year) , NSIT >>>>>>>>>>>>> http://iblogmythots.wordpress.com/ >>>>>>>>>>>>> >>>>>>>>>>>>> -- >>>>>>>>>>>>> You received this message because you are subscribed to the >>>>>>>>>>>>> Google Groups "Algorithm Geeks" group. >>>>>>>>>>>>> To post to this group, send email to >>>>>>>>>>>>> algogeeks@googlegroups.com. >>>>>>>>>>>>> To unsubscribe from this group, send email to >>>>>>>>>>>>> algogeeks+unsubscr...@googlegroups.com. >>>>>>>>>>>>> For more options, visit this group at >>>>>>>>>>>>> http://groups.google.com/group/algogeeks?hl=en. >>>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> -- >>>>>>>>>>>> Regards, >>>>>>>>>>>> Kamakshi >>>>>>>>>>>> kamakshi...@gmail.com >>>>>>>>>>>> >>>>>>>>>>>> -- >>>>>>>>>>>> You received this message because you are subscribed to the >>>>>>>>>>>> Google Groups "Algorithm Geeks" group. >>>>>>>>>>>> To post to this group, send email to algogeeks@googlegroups.com >>>>>>>>>>>> . >>>>>>>>>>>> To unsubscribe from this group, send email to >>>>>>>>>>>> algogeeks+unsubscr...@googlegroups.com. >>>>>>>>>>>> For more options, visit this group at >>>>>>>>>>>> http://groups.google.com/group/algogeeks?hl=en. >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> -- >>>>>>>>>>> You received this message because you are subscribed to the >>>>>>>>>>> Google Groups "Algorithm Geeks" group. >>>>>>>>>>> To post to this group, send email to algogeeks@googlegroups.com. >>>>>>>>>>> To unsubscribe from this group, send email to >>>>>>>>>>> algogeeks+unsubscr...@googlegroups.com. >>>>>>>>>>> For more options, visit this group at >>>>>>>>>>> http://groups.google.com/group/algogeeks?hl=en. >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> -- >>>>>>>>>> Regards, >>>>>>>>>> Kamakshi >>>>>>>>>> kamakshi...@gmail.com >>>>>>>>>> >>>>>>>>>> -- >>>>>>>>>> You received this message because you are subscribed to the Google >>>>>>>>>> Groups "Algorithm Geeks" group. >>>>>>>>>> To post to this group, send email to algogeeks@googlegroups.com. >>>>>>>>>> To unsubscribe from this group, send email to >>>>>>>>>> algogeeks+unsubscr...@googlegroups.com. >>>>>>>>>> For more options, visit this group at >>>>>>>>>> http://groups.google.com/group/algogeeks?hl=en. >>>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> You received this message because you are subscribed to the Google >>>>>>>>> Groups "Algorithm Geeks" group. >>>>>>>>> To post to this group, send email to algogeeks@googlegroups.com. >>>>>>>>> To unsubscribe from this group, send email to >>>>>>>>> algogeeks+unsubscr...@googlegroups.com. >>>>>>>>> For more options, visit this group at >>>>>>>>> http://groups.google.com/group/algogeeks?hl=en. >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> Sanchit Manchanda >>>>>>>> COE(3rd year) , NSIT >>>>>>>> http://iblogmythots.wordpress.com/ >>>>>>>> >>>>>>>> -- >>>>>>>> You received this message because you are subscribed to the Google >>>>>>>> Groups "Algorithm Geeks" group. >>>>>>>> To post to this group, send email to algogeeks@googlegroups.com. >>>>>>>> To unsubscribe from this group, send email to >>>>>>>> algogeeks+unsubscr...@googlegroups.com. >>>>>>>> For more options, visit this group at >>>>>>>> http://groups.google.com/group/algogeeks?hl=en. >>>>>>>> >>>>>>> >>>>>>> -- >>>>>>> You received this message because you are subscribed to the Google >>>>>>> Groups "Algorithm Geeks" group. >>>>>>> To post to this group, send email to algogeeks@googlegroups.com. >>>>>>> To unsubscribe from this group, send email to >>>>>>> algogeeks+unsubscr...@googlegroups.com. >>>>>>> For more options, visit this group at >>>>>>> http://groups.google.com/group/algogeeks?hl=en. >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Sanchit Manchanda >>>>>> COE(3rd year) , NSIT >>>>>> http://iblogmythots.wordpress.com/ >>>>>> >>>>>> -- >>>>>> You received this message because you are subscribed to the Google >>>>>> Groups "Algorithm Geeks" group. >>>>>> To post to this group, send email to algogeeks@googlegroups.com. >>>>>> To unsubscribe from this group, send email to >>>>>> algogeeks+unsubscr...@googlegroups.com. >>>>>> For more options, visit this group at >>>>>> http://groups.google.com/group/algogeeks?hl=en. >>>>>> >>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "Algorithm Geeks" group. >>>>> To post to this group, send email to algogeeks@googlegroups.com. >>>>> To unsubscribe from this group, send email to >>>>> algogeeks+unsubscr...@googlegroups.com. >>>>> For more options, visit this group at >>>>> http://groups.google.com/group/algogeeks?hl=en. >>>>> >>>> >>>> >>>> >>>> -- >>>> Aditi Garg >>>> Undergraduate Student >>>> Electronics & Communication Divison >>>> NETAJI SUBHAS INSTITUTE OF TECHNOLOGY >>>> Sector 3, Dwarka >>>> New Delhi >>>> >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Algorithm Geeks" group. >>>> To post to this group, send email to algogeeks@googlegroups.com. >>>> To unsubscribe from this group, send email to >>>> algogeeks+unsubscr...@googlegroups.com. >>>> For more options, visit this group at >>>> http://groups.google.com/group/algogeeks?hl=en. >>>> >>> >>> >>> >>> -- >>> Sanchit Manchanda >>> COE(3rd year) , NSIT >>> http://iblogmythots.wordpress.com/ >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Algorithm Geeks" group. >>> To post to this group, send email to algogeeks@googlegroups.com. >>> To unsubscribe from this group, send email to >>> algogeeks+unsubscr...@googlegroups.com. >>> For more options, visit this group at >>> http://groups.google.com/group/algogeeks?hl=en. >>> >> >> >> >> -- >> Regards, >> Kamakshi >> kamakshi...@gmail.com >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- Aditi Garg Undergraduate Student Electronics & Communication Divison NETAJI SUBHAS INSTITUTE OF TECHNOLOGY Sector 3, Dwarka New Delhi -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.