Advertisement

sizeof() vs strlen()

Started by March 04, 2004 02:56 AM
1 comment, last by psteijn 21 years ago
both return the same value when performed on a character array. which one is faster?
time you enjoyed wasting was not wasted
lol nevermind they won''t return the same value... but still which one is faster in general?
time you enjoyed wasting was not wasted
Advertisement
sizeof and strlen perform completely different tasks. Which one is faster is irrelevant.

For the record, sizeof is a compile time look up, strlen calculates the length of a string at runtime.

This topic is closed to new replies.

Advertisement