fork download
  1. #include<stdio.h>
  2.  
  3. int main(void)
  4. {
  5. char a[16]="abcdefh";
  6. char *b="ijk";
  7. int c=0;
  8. char d=0;
  9.  
  10. while(*a!='\0'){
  11. printf("%c",*a);
  12. c++;
  13. *a=*(a+c);
  14. printf(" %s\n", a);
  15. }
  16. printf("文字列の長さは%d\n",c);
  17.  
  18. *a='a';
  19. while(1){
  20. printf("%s\n", a);
  21. *(a+c)=*(b+d);
  22. c++;
  23. d++;
  24. if(*(b+d)=='\0'){
  25. break;
  26. }
  27. }
  28. printf("%s\n",a);
  29. return 0;
  30. }
Success #stdin #stdout 0.01s 1676KB
stdin
Standard input is empty
stdout
a  bbcdefh
b  cbcdefh
c  dbcdefh
d  ebcdefh
e  fbcdefh
f  hbcdefh
h  
文字列の長さは7
abcdefh
abcdefhi
abcdefhij
abcdefhijk