3
Good afternoon to all,
I was studying some algorithms in C [especially Strings] and I couldn’t help noticing that fgets()
and scanf()
for reading strings often, but rarely use the gets()
[Which is even accused by some compilers as 'not safe']. I would like, if possible, that some of my doubts were resolved
- What is the difference between the 3 in running time.
- What is the reason for using the
fgets()
that thegets()
for strings. - Because the
gets()
is considered a "unsafe". fgets()
orscanf()
, what is the most appropriate for string handling?
Thank you in advance for your attention.
P.S.: If it has not been clear so far my doubt, please signal so that I can correct.
This https://answall.com/q/42981/101?
– Maniero
Exactly that, thank you!
– H.Lima