Return Value of strchr()
The strchr() function returns a pointer to the first occurrence of the character in the string. If the character is not found, the function returns NULL. Here, the return type is char *, which allows direct access to the character and subsequent characters in the string from the found position.
strchr in C
The strchr() function in C is a predefined function in the <string.h> library. It is used to find the first occurrence of a character in a string. It checks whether the given character is present in the given string or not, if the character is found it returns the pointer to it otherwise it returns a null pointer indicating the character is not found in the string.
Contact Us