- 1
"warning: the `gets' function is dangerous and should not be used"
I tried the second example in https://www.sololearn.com/Play/C: #include <stdio.h> int main() { char a[100]; gets(a); printf("You entered: "); puts(a); return 0; } But this is all I got back: You entered: yhchc ./Playground/file0.c: In function 'main': ./Playground/file0.c:6:3: warning: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 6 | gets(a); | ^~~~ | fgets ../Playground/: /tmp/cc3atX1G.o: in function `main': file0.c:(.text+0x15): warning: the `gets' function is dangerous and should not be used.
3 odpowiedzi
0
Yeah we should always (not always😁)use" post"