fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main()
  5. {
  6. Char str[1000];
  7. Int length;
  8. ptintf("Nhap chuoi: ");
  9. scanf("%s", &str);
  10.  
  11. For(i=0; str[i]!='\0'; i++)
  12.  
  13. printf("do dai cua chuoi la: %d");
  14. return 0;
  15. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
4
compilation info
prog.c: In function ‘main’:
prog.c:6:5: error: unknown type name ‘Char’; did you mean ‘char’?
     Char str[1000];
     ^~~~
     char
prog.c:7:2: error: unknown type name ‘Int’; did you mean ‘int’?
  Int length;
  ^~~
  int
prog.c:8:5: warning: implicit declaration of function ‘ptintf’; did you mean ‘printf’? [-Wimplicit-function-declaration]
     ptintf("Nhap chuoi: ");
     ^~~~~~
     printf
prog.c:9:13: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘int (*)[1000]’ [-Wformat=]
     scanf("%s", &str);
            ~^   ~~~~
prog.c:11:1: warning: implicit declaration of function ‘For’ [-Wimplicit-function-declaration]
 For(i=0; str[i]!='\0'; i++)
 ^~~
prog.c:11:5: error: ‘i’ undeclared (first use in this function)
 For(i=0; str[i]!='\0'; i++)
     ^
prog.c:11:5: note: each undeclared identifier is reported only once for each function it appears in
prog.c:11:8: error: expected ‘)’ before ‘;’ token
 For(i=0; str[i]!='\0'; i++)
        ^
        )
prog.c:11:28: error: expected ‘;’ before ‘printf’
 For(i=0; str[i]!='\0'; i++)
                            ^
                            ;
prog.c:13:1:
 printf("do dai cua chuoi la: %d");
 ~~~~~~                      
prog.c:7:6: warning: unused variable ‘length’ [-Wunused-variable]
  Int length;
      ^~~~~~
prog.c:9:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%s", &str);
     ^~~~~~~~~~~~~~~~~
stdout
Standard output is empty