The strlen function returns the length of a string, excluding the ________.
- null terminator
- first character
- whitespace characters
- special characters
The correct answer is the null terminator. The strlen function in C/C++ returns the length of a string by counting characters until it encounters the null terminator (' '). It excludes the null terminator from the count. The other options are not what strlen excludes.
Loading...
Related Quiz
- What is the primary purpose of using pointers in a C function?
- What potential problem might occur when using fseek and ftell with large binary files?
- What is a potential drawback of using bit fields in a cross-platform application?
- You are developing a large-scale simulation that runs for a long duration. After running for a few hours, you notice the program slows down significantly. What could be a likely reason for this behavior?
- What might be a reason to use bit fields when designing a system with strict memory constraints?