Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
Sizeof vs. Strlen
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Ralmin, post: 1712469"] The other replies to your post have covered the case of applying sizeof to something other than a string literal. I just thought I would point out that even string literals can give quite different results between sizeof(S)-1 and strlen(S). consider when S is "hello \0 world". sizeof "hello \0 world" - 1 == 13 strlen("hello \0 world") == 6 [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
Sizeof vs. Strlen
Top