You're developing a text editor and need to implement a search feature. Which function could be useful to check if a certain word exists in a text?
- strcat
- strlen
- strrev
- strstr
In this scenario, the strstr function is appropriate for searching for a specific word within a text. It returns a pointer to the first occurrence of the specified word in the text, allowing you to check if it exists. strrev reverses a string, strlen provides the length of a string, and strcat concatenates strings.
Loading...
Related Quiz
- You are working on a software project in C++ that requires sorting a list of items in multiple ways. How could you leverage function overloading to achieve this?
- Command line arguments are accessed in a C program using the parameters ________ and ________ in the main function.
- An array of structures in C allows you to store multiple records, where each record can have ________ of different data types.
- In a C++ application, you notice that a function is being called with different types of arguments, but there is only one function definition. What feature of C++ could be allowing this behavior?
- While reviewing a C program, you come across a scenario where a pointer is freed but later used in the program. What issue could this lead to?