I wrote a string copy program using pointer,but it got a segmentation fault,don't know why.
Thanks
here is my code:
#include<stdio.h>
void strcp(char *s,char *t){
while(*s++=*t++)
;
}
void main(){
char *d="this is destination";
char *s="this is source";
strcp(d,s);
while(d++){
printf("%s " ,*d);
}
return;
}