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