The function ________ is used to find the first occurrence of a character in a string in C.
- findchar
- locatechar
- strchr
- searchchar
The correct answer is strchr. strchr is a standard C function used to find the first occurrence of a character in a string. The other options are not valid C functions for this purpose.
Loading...
Related Quiz
- You need to implement a function that modifies multiple variables of different data types. What concept related to pointers would you use?
- When a function receives a pointer as an argument, it can modify the ________ that the pointer points to.
- What is the scope of a global variable in a C program?
- You are working on a program that processes large datasets. Why might you choose to use pointers and pointer arithmetic to traverse the data?
- What is the advantage of using function pointers in C for implementing callback functions?