Weird behavior | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Weird behavior

Can anybody know what’s wrong with this little code, where the 10 came from?! https://code.sololearn.com/cTqhnqLBQt7h/?ref=app

26th Jan 2019, 10:39 PM
Mostafa Ehab
Mostafa Ehab - avatar
2 Answers
+ 2
10 is the ascii code for the line feed. I found this in the lesson about fgets: "Another difference between gets and fgets is that the newline character is stored by fgets." https://www.sololearn.com/learn/C/2936/?ref=app gets (input) works.
26th Jan 2019, 11:36 PM
Denise Roßberg
Denise Roßberg - avatar
0
That’s wright, thanks..😃
27th Jan 2019, 4:57 AM
Mostafa Ehab
Mostafa Ehab - avatar