fork download
  1. # include <stdio.h>
  2.  
  3. int mystrlen(char *str);
  4. int main(void)
  5. {
  6. char input[100];
  7. int input;
  8.  
  9. printf("문장을 입력하시오.");
  10. scanf("%s",input);
  11. printf("문장의 길이는 %d입니다." mystrlen(input));
  12. }
  13. int mystrlen(char *str);
  14. {
  15. int i;
  16. for(i=0; str[i]='\0'; i++);
  17. return i;
  18. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:7:6: error: conflicting types for ‘input’
  int input;
      ^~~~~
prog.c:6:7: note: previous declaration of ‘input’ was here
  char input[100];
       ^~~~~
prog.c:10:10: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘int’ [-Wformat=]
  scanf("%s",input);
          ^
prog.c:11:44: error: expected ‘)’ before ‘mystrlen’
  printf("문장의 길이는 %d입니다." mystrlen(input));
                                            ^~~~~~~~
prog.c:11:31: warning: format ‘%d’ expects a matching ‘int’ argument [-Wformat=]
  printf("문장의 길이는 %d입니다." mystrlen(input));
                               ^
prog.c: At top level:
prog.c:14:1: error: expected identifier or ‘(’ before ‘{’ token
 {
 ^
stdout
Standard output is empty