Return a pointer to the right most n characters in a string.
const char * strright( const char * pcsz, int n );
The return value either a pointer to the first character which is the nth character from the end of the string or a pointer to the first character in the string if the string is shorter than n.
char szBuf = "abcdefg";
char *pszRightThree = strright( szBuf, 3 );
// pszRightThree is now a pointer to "efg" within szBuf
See also none