/*---------------------------------------------------------------------- Copyright (c) 1998 Gipsysoft. All Rights Reserved. File: strright.cpp Owner: russf@gipsysoft.com Web site: http://www.gipsysoft.com Purpose: Return a pointer to the right n characters in the string so for "abcdefg" and an n of 3 it would return a pointer to "efg". If the string is not long enough then it will return a pointer to the string passed. ----------------------------------------------------------------------*/ #include "stdafx.h" extern const char * strright( const char * pcsz, int n ); const char * strright( const char * pcsz, int n ) // { const char * pcszTest = pcsz; while( *pcszTest ) pcszTest++; if( pcszTest - pcsz > n ) { pcsz = pcszTest - n; } return pcsz; }