What is the return type of the strlen function in C?
- char
- int
- size_t
- void
The strlen function in C returns a value of type size_t, which represents the size or length of the string. Using size_t is more appropriate as it can handle large string lengths and is an unsigned integer type.
Loading...
Related Quiz
- Which standard library function in C is used to concatenate two strings?
- In C, a string is essentially an array of ________ terminated by a null character.
- You are developing an interactive application that continuously accepts user input until the user decides to exit. Which loop construct would be most appropriate for this scenario?
- In C, an array name acts as a ________ pointing to the first element of the array.
- You're working on a C program that needs to manipulate and process data about a list of products in a store. Each product has several attributes like name, price, and quantity. What approach would you take to store and process this data efficiently?