#1 컴파일 에러 timer 0ms memory 0MB
tips_and_updates 팁
변수나 함수가 선언되지 않았어요.
변수나 함수를 선언하고 사용하고 있는지 확인해 보세요.
혹은 이 스코프 바깥에서 선언된 변수나 함수를 사용하고 있지는 않나요? Main.cpp: In function ‘int main()’:
Main.cpp:8:20: error: invalid conversion from ‘char’ to ‘const char*’ [-fpermissive]
8 | int len=strlen(ch);
| ^~
| |
| char
In file included from Main.cpp:2:
/usr/include/string.h:407:35: note: initializing argument 1 of ‘size_t strlen(const char*)’
407 | extern size_t strlen (const char *__s)
| ~~~~~~~~~~~~^~~
Main.cpp:10:15: error: invalid types ‘char[int]’ for array subscript
10 | if (ch[i]==' ') {
| ^
Main.cpp:16:19: error: ‘wnct’ was not declared in this scope; did you mean ‘wcnt’?
16 | words[wnct][wlen]=ch[i];
| ^~~~
| wcnt
Main.cpp:16:33: error: invalid types ‘char[int]’ for array subscript
16 | words[wnct][wlen]=ch[i];
| ^
Main.cpp:7:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%[^\r\n]",&ch);
| ~~~~~^~~~~~~~~~~~~~~~