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
No. This is one of the places that the C++ std::string class has an obvious advantage -- along with std::string::find(), there's also std::string::rfind().
std::string::find()
std::string::rfind()