+ 1
Wrong stringsizes printing. Why?
If you input cat, dog and rat into code, Stringsize output for cat and dog is 4, but for rat is 3 Why? Code: https://code.sololearn.com/caeYtyr8q9qS/?ref=app Thanks for advance
2 ответов
+ 3
you can see here in second paragraph http://www.cplusplus.com/reference/cstdio/fgets/
`A newline character makes fgets stop reading, but it is considered a valid character by the function and included in the string copied to str.`
you can prove it by check their last character and see if its \n or not
0
Thank you good sir!