@ankur: But the same above code wont show any error on my gcc 4.3.2 running on Open Suse 11.4 ....
On Fri, Jul 29, 2011 at 11:48 PM, Ankur Khurana <ankur.kkhur...@gmail.com>wrote: > http://ideone.com/OaCDR > > > On Fri, Jul 29, 2011 at 11:45 PM, rajeev bharshetty > <rajeevr...@gmail.com>wrote: > >> @ankur :which compiler are u using?? >> >> >> On Fri, Jul 29, 2011 at 11:39 PM, Ankur Khurana <ankur.kkhur...@gmail.com >> > wrote: >> >>> @rajeev: your code gives compilation error. >>> >>> >>> On Fri, Jul 29, 2011 at 11:39 PM, Ankur Khurana < >>> ankur.kkhur...@gmail.com> wrote: >>> >>>> no , >>>> n[0] is *(n+0) >>>> so actually n is being dereferenced here .Check the basci diff >>>> >>>> p is a pointer , but n is a pointer to a pointer. >>>> >>>> >>>> On Fri, Jul 29, 2011 at 11:34 PM, Arshad Alam <alam3...@gmail.com>wrote: >>>> >>>>> wow great... but why it is so yaar? >>>>> ptr=n and ptr=n[0] is same na? >>>>> >>>>> >>>>> On Fri, Jul 29, 2011 at 11:27 PM, rajeev bharshetty < >>>>> rajeevr...@gmail.com> wrote: >>>>> >>>>>> #include<stdio.h> >>>>>> >>>>>> void main() >>>>>> { >>>>>> int n[3][3]= { >>>>>> 2,4,3, >>>>>> 6,8,5, >>>>>> 3,5,1 >>>>>> }; >>>>>> int i,*ptr; >>>>>> ptr= n; >>>>>> for(i=0;i<=8;i++) >>>>>> printf("\n%d",*(ptr+i)); >>>>>> >>>>>> } >>>>>> >>>>>> In gcc 4.3.2 no error ,it is just showing a warning as >>>>>> >>>>>> ms50.c: In function ‘main’: >>>>>> ms50.c:11:8: warning: assignment from incompatible pointer type >>>>>> >>>>>> change the statement as ptr = n[0] warning vanishes >>>>>> >>>>>> On Fri, Jul 29, 2011 at 11:17 PM, Arshad Alam <alam3...@gmail.com>wrote: >>>>>> >>>>>>> what's the problem with line number 12? >>>>>>> >>>>>>> 1 #include<stdio.h> >>>>>>> 2 #include<conio.h> >>>>>>> 3 void main() >>>>>>> 4 { >>>>>>> 5 clrscr(); >>>>>>> 6 int n[3][3]= { >>>>>>> 7 2,4,3, >>>>>>> 8 6,8,5, >>>>>>> 9 3,5,1 >>>>>>> 10 }; >>>>>>> 11 int i,*ptr; >>>>>>> 12 ptr=n; >>>>>>> 13 for(i=0;i<=8;i++) >>>>>>> 14 printf("\n%d",*(ptr+i)); >>>>>>> 15 getch(); >>>>>>> } >>>>>>> >>>>>>> -- >>>>>>> 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 >>>>>> Rajeev N B <http://www.opensourcemania.co.cc> >>>>>> >>>>>> "*Winners Don't do Different things , they do things Differently"* >>>>>> >>>>>> -- >>>>>> 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. >>>>> >>>> >>>> >>>> >>>> -- >>>> Ankur Khurana >>>> Computer Science >>>> Netaji Subhas Institute Of Technology >>>> Delhi. >>>> >>>> >>> >>> >>> -- >>> Ankur Khurana >>> Computer Science >>> Netaji Subhas Institute Of Technology >>> 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. >>> >> >> >> >> -- >> Regards >> Rajeev N B <http://www.opensourcemania.co.cc> >> >> "*Winners Don't do Different things , they do things Differently"* >> >> -- >> 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. >> > > > > -- > Ankur Khurana > Computer Science > Netaji Subhas Institute Of Technology > 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. > -- Regards Rajeev N B <http://www.opensourcemania.co.cc> "*Winners Don't do Different things , they do things Differently"* -- 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.