I am trying to find a similar function to strstr that searches a substring starting from the end towards the beginning of the string.
strstr
You can use standard algorithm std::find_end for this purpose. For example
char s[] = "What is the last word last"; char t[] = "last"; std::cout << std::find_end( s, s + sizeof( s ) - 1, t, t + sizeof( t ) -1 ) << std::endl;