+ 1
Can anyone tell me the what's the use of getchar() and gets() ? In simple explanation please. I'm a beginner .
3 Respuestas
+ 3
..getchar reads one character like 'x'
...gets reads multiple characters like 'abc'
You need this if you want to get input from a user.
https://www.tutorialspoint.com/c_standard_library/c_function_getchar.htm
https://www.tutorialspoint.com/c_standard_library/c_function_gets.htm#:~:text=The%20C%20library%20function%20char,is%20reached%2C%20whichever%20comes%20first.
+ 4
Don't forget that 'gets' is deprecated because of security issues (so don't use it).
+ 1
Ty very much 😊