strcmp, at least using g++, has many optimitzations for many architectures. In my pc, a Core2Duo E8400, strcmp is two times faster than use a straigforward implementation.
My question if it exists some library that provides a function that compares two "reverse strings". A reverse string char *s1
starts in s1
and ends at some s1-n
such that s1-n == '\0'
(where n >= 0
and for all 0 <= n' < n, s1-n' != '\0'
).
Of course, the requirements are that this function must be so efficient and portable as strcmp.
edit: I just need know if two strings are equals (so i do not need know which are greater. Then the same optimitzations for strcmp, in principle, will work fine for a reverse strings).