*void main() *{* int i; char *a="String"; char *p="New String"; char *Temp; Temp=a; a=malloc(strlen(p) + 1); strcpy(a,p); p = malloc(strlen(Temp) + 1); strcpy(p,Temp); printf("(%s, %s)",a,p); free(p); free(a); } * * * * * *output is (New String,String)* * * *how does Temp retains "String" even after New String is copied in a? Is it not pointing to the same location?pls explain*
-- 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.