Re: [algogeeks] Simple Question ,Find Error

2012-06-04 Thread Raghavendhra Chowdary MV
names[3] = names[4]; //Cant be done like these as they are char arrays On Mon, Jun 4, 2012 at 4:12 AM, mahendra sengar sengar.m...@gmail.comwrote: main() { static char names[5][20]={pascal,ada,cobol,fortran,perl}; int i; char *t; t=names[3]; names[3]=names[4]; names[4]=t; for

Re: [algogeeks] Simple Question ,Find Error

2012-06-04 Thread Nishant Pandey
actually the address of name is constant and that get modifed , so thats not possible once name is converted to pointer then this assignment is posible . On Mon, Jun 4, 2012 at 10:51 AM, Hassan Monfared hmonfa...@gmail.comwrote: you can't assign value into names[i]! On Mon, Jun 4, 2012 at

RE: [algogeeks] Simple Question ,Find Error

2012-06-04 Thread abhishek
This code have issue. names[3]=names[4]; names[4]=t; -Original Message- From: algogeeks@googlegroups.com [mailto:algogeeks@googlegroups.com] On Behalf Of mahendra sengar Sent: Monday, June 04, 2012 4:13 AM To: Algorithm Geeks Cc: sengar.m...@gmail.com Subject: [algogeeks] Simple Question

Re: [algogeeks] Simple Question ,Find Error

2012-06-04 Thread sengar.mahi
: algogeeks@googlegroups.com [mailto:algogeeks@googlegroups.com] On Behalf Of mahendra sengar Sent: Monday, June 04, 2012 4:13 AM To: Algorithm Geeks Cc: sengar.m...@gmail.com Subject: [algogeeks] Simple Question ,Find Error main() { static char names[5][20]={pascal,ada,cobol,fortran,perl}; int i

[algogeeks] Simple Question ,Find Error

2012-06-03 Thread mahendra sengar
main() { static char names[5][20]={pascal,ada,cobol,fortran,perl}; int i; char *t; t=names[3]; names[3]=names[4]; names[4]=t; for (i=0;i=4;i++) printf(%s,names[i]); } -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send

Re: [algogeeks] Simple Question ,Find Error

2012-06-03 Thread Hassan Monfared
you can't assign value into names[i]! On Mon, Jun 4, 2012 at 3:12 AM, mahendra sengar sengar.m...@gmail.comwrote: main() { static char names[5][20]={pascal,ada,cobol,fortran,perl}; int i; char *t; t=names[3]; names[3]=names[4]; names[4]=t; for (i=0;i=4;i++) printf(%s,names[i]); }