strlen and string

Asked 2 years ago, Updated 2 years ago, 135 views

I wonder why David921 read from the file through the strlen function has a length of 9. When reading the same David921 length through gets, the length is 8 so I wonder why this difference occurs.

strlen string fileinputstream

2022-09-22 11:53

2 Answers

I don't know, but... Isn't it the difference between \0 and no?


2022-09-22 11:53

David921 Isn't there a new line character behind it?


2022-09-22 11:53

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.