[Solved] Why gets() function is dangerous to use in code? Please help me understand the following warning.
Below is the description mentioned in lesson: The gets() function is used to read input as an ordered sequence of characters, also called a string. A string is stored in a char array. TIY code example: https://www.sololearn.com/learning/1089/2914/6296/1 This warning I received every time when input is given as char int, string or just one letter. I did not understood what warning here means. /Playground/file0.c: In function 'main': ./Playground/file0.c:6:5: warning: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 6 | gets(a); | ^~~~ | fgets ../Playground/: /tmp/ccI0Ulhr.o: in function `main': file0.c:(.text+0x15): warning: the `gets' function is dangerous and should not be used. What I understood through this example is, the char a[100] ..... that defines length of elements stored in array. And, due to warning I am confused which function is better to use gets() or fgets()? [I may be just assuming or could be completely wrong about "char