Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis+ 4
Is there any difference between gets and scanf
3 Respostas
+ 4
The mainĀ difference betweenĀ them is:scanf() reads input until it encounters whitespace, newline or End Of File(EOF) whereasĀ gets() reads input until it encounters newline or End Of File(EOF),Ā gets() does not stop reading input when it encounters whitespace instead it takes whitespace as a string.
+ 3
Scanf stops reading the input when it encounters a whitespace, while gets doesn't; and gets is only used to get strings, while scanf can be used to get any datatype
+ 1
Thxs Vepa