fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3. int main() {
  4. char str1[100], str2[100];
  5. fgets(str1, 100, stdin);
  6. fgets(str2, 100, stdin);
  7.  
  8. strcpy(str1, "Hello");
  9. printf("strcpy: %s\n", str1);
  10.  
  11. strcat(str1, " World");
  12. printf("strcat: %s\n", str1);
  13.  
  14. printf("strcmp: %d\n", strcmp(str1, str2));
  15.  
  16. printf("strlen: %lu\n", strlen(str1));
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
strcpy: Hello
strcat: Hello World
strcmp: 72
strlen: 11