coz in funtion array decays to pointer to one d array...correct if wrng??? On Aug 27, 9:52 pm, raj kumar <megamonste...@gmail.com> wrote: > modify(char a[],char *b) > { > a[0]='a'//gives runtime error why? > b[0]='b'//gives runtime error > > } > > main() > { > char p[]="hello"; > char *x="hello"; > x[0]='x';//will give run time error i know why > p[0]='p' //works fine i know why > modify("string","pointer"); > > } > > why un function modify both the assignments give runtiie error are both a > and b acting as pointers to some constant strings
-- 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.