Warning: implode(): Invalid arguments passed in /www/wwwroot/jobquiz.info/mdiscuss.php on line 336 Which standard library function will you use to find the last occurance of a character in a string in C? ?->(Show Answer!)
1. Which standard library function will you use to find the last occurance of a character in a string in C?
Ask Your Doubts Here
Comments
By: guest on 01 Jun 2017 06.02 pm
strrchr() returns a pointer to the last occurrence of character in a string. Example: #include <stdio.h> #include <string.h> int main() { char str[30] = "12345678910111213"; printf("The last position of '2' is %d.\n", strrchr(str, '2') - str); return 0; } Output: The last position of '2' is 14.