strlen tag

2 questions


2 answers
135 views
0
strlen and string

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.


1 answers
112 views
0
Is strlen() calculated every time in the for statement?

for (int i = 0; i < strlen(ss); ++i){ // Hello}If you think about it, the ss might change inside the for statementI think strlen(ss) should be calculated every timeBut if you do strlen() every time...

2 years ago

© 2024 OneMinuteCode. All rights reserved.