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