Warnings while learning C language in the examples | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Warnings while learning C language in the examples

I tried few examples to learn about the "get()" function but every time I tried them, I have this warning message : ./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/cci1fCkd.o: in function main': file0.c:(.text+0x15): warning: the gets' function is dangerous and should not be used. WHY ?

21st Feb 2023, 8:07 PM
Kenza Benmansour
Kenza Benmansour - avatar
1 Answer