fork download
  1. # include <stdio.h>
  2.  
  3. void myStrcpy(char s[], char t[]){
  4. int *p=s;
  5. int *q=t;
  6. for(int i=0;s[i]!='\0';i++){
  7. *(q+i)=*(p+i);
  8. }
  9. return;
  10. }
  11.  
  12. int main(){
  13. int len;
  14. char s[100];
  15. char t[100];
  16. scanf("%s",s);
  17. myStrcpy(s,t);
  18. printf("s : %s\nt : %s\n",s,t);
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0s 5324KB
stdin
abcd
stdout
s : abcd
t : abcd