[algogeeks] problem at line number 12
what's the problem with line number 12? 1#includestdio.h 2#includeconio.h 3void main() 4 { 5clrscr(); 6int 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++) 14printf(\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.
Re: [algogeeks] problem at line number 12
#includestdio.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#includestdio.h 2#includeconio.h 3void main() 4 { 5clrscr(); 6int 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++) 14printf(\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.
Re: [algogeeks] problem at line number 12
try this #includestdio.h void main() { int n[3][3]= { 2,4,3, 6,8,5, 3,5,1 }; int i,*ptr; ptr= (int *) n; for(i=0;i=8;i++) printf(\n%d,*(ptr+i)); } On Fri, Jul 29, 2011 at 11:27 PM, rajeev bharshetty rajeevr...@gmail.comwrote: #includestdio.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#includestdio.h 2#includeconio.h 3void main() 4 { 5clrscr(); 6int 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++) 14printf(\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. -- 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.
Re: [algogeeks] problem at line number 12
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.comwrote: #includestdio.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#includestdio.h 2#includeconio.h 3void main() 4 { 5clrscr(); 6int 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++) 14printf(\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.
Re: [algogeeks] problem at line number 12
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.comwrote: #includestdio.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#includestdio.h 2#includeconio.h 3void main() 4 { 5clrscr(); 6int 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++) 14printf(\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. -- 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.
Re: [algogeeks] problem at line number 12
@rajeev: your code gives compilation error. On Fri, Jul 29, 2011 at 11:39 PM, Ankur Khurana ankur.kkhur...@gmail.comwrote: 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: #includestdio.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.comwrote: what's the problem with line number 12? 1#includestdio.h 2#includeconio.h 3void main() 4 { 5clrscr(); 6int 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++) 14printf(\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.
Re: [algogeeks] problem at line number 12
@ankur :which compiler are u using?? On Fri, Jul 29, 2011 at 11:39 PM, Ankur Khurana ankur.kkhur...@gmail.comwrote: @rajeev: your code gives compilation error. On Fri, Jul 29, 2011 at 11:39 PM, Ankur Khurana ankur.kkhur...@gmail.comwrote: 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: #includestdio.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.comwrote: what's the problem with line number 12? 1#includestdio.h 2#includeconio.h 3void main() 4 { 5clrscr(); 6int 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++) 14printf(\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.
Re: [algogeeks] problem at line number 12
http://ideone.com/OaCDR On Fri, Jul 29, 2011 at 11:45 PM, rajeev bharshetty rajeevr...@gmail.comwrote: @ankur :which compiler are u using?? On Fri, Jul 29, 2011 at 11:39 PM, Ankur Khurana ankur.kkhur...@gmail.comwrote: @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.comwrote: 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: #includestdio.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.comwrote: what's the problem with line number 12? 1#includestdio.h 2#includeconio.h 3void main() 4 { 5clrscr(); 6int 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++) 14printf(\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.
Re: [algogeeks] problem at line number 12
@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.comwrote: http://ideone.com/OaCDR On Fri, Jul 29, 2011 at 11:45 PM, rajeev bharshetty rajeevr...@gmail.comwrote: @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.comwrote: 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: #includestdio.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.comwrote: what's the problem with line number 12? 1#includestdio.h 2#includeconio.h 3void main() 4 { 5clrscr(); 6int 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++) 14printf(\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.
Re: [algogeeks] problem at line number 12
@ankur : Dude I think you compiled in ideone as C++ language but it is C :) http://ideone.com/HZhHu On Fri, Jul 29, 2011 at 11:51 PM, rajeev bharshetty rajeevr...@gmail.comwrote: @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.comwrote: 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.comwrote: 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: #includestdio.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.comwrote: what's the problem with line number 12? 1#includestdio.h 2#includeconio.h 3void main() 4 { 5clrscr(); 6int 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++) 14printf(\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* -- 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
Re: [algogeeks] problem at line number 12
Thanks for pointing that out, my apologies . . . On Fri, Jul 29, 2011 at 11:53 PM, rajeev bharshetty rajeevr...@gmail.comwrote: @ankur : Dude I think you compiled in ideone as C++ language but it is C :) http://ideone.com/HZhHu On Fri, Jul 29, 2011 at 11:51 PM, rajeev bharshetty rajeevr...@gmail.comwrote: @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.comwrote: 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: #includestdio.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.comwrote: what's the problem with line number 12? 1#includestdio.h 2#includeconio.h 3void main() 4 { 5clrscr(); 6int 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++) 14printf(\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* -- Regards Rajeev N B
Re: [algogeeks] problem at line number 12
AFAIK , it is adaptation of gcc standards, which is the problem with mingw as well . So i use ideone to check my answer as it uses spoj engine which is considered more standard. I guess that is the reason, i cant think of other On Fri, Jul 29, 2011 at 11:51 PM, rajeev bharshetty rajeevr...@gmail.comwrote: @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.comwrote: 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.comwrote: 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: #includestdio.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.comwrote: what's the problem with line number 12? 1#includestdio.h 2#includeconio.h 3void main() 4 { 5clrscr(); 6int 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++) 14printf(\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