fork download
  1. #include<stdio.h>
  2.  
  3. int main(void)
  4. {
  5. char str[16] = "abcdefh";
  6. char *str2 = "ijk";
  7. int len;
  8.  
  9. for (len = 0; str[len] != '\0'; printf("%c\n", str[len++]));
  10. printf("文字列の長さは%d\n", len);
  11.  
  12. while (*str2 != '\0') {
  13. str[len++] = *(str2++);
  14. }
  15. printf("%s\n", str);
  16.  
  17. return 0;
  18. }
Success #stdin #stdout 0.01s 1720KB
stdin
Standard input is empty
stdout
a
b
c
d
e
f
h
文字列の長さは7
abcdefhijk