|
Сбросьте примеры трансляции простой функции
//
// ** strtrm -- the function removes trailing spaces and tabs from a string.
// Returns a pointer to the string
//
char *strtrm(char *ptr)
{
char *_pt = ptr;
char _ch;while (*_pt++); // Find the string end
--_pt; // Adjust pointer
while (_pt > ptr) // Go to the sring start
{
_ch = *--_pt; // Get byte
if (_ch!=' ' && _ch!='\t') // It's not a space or tab
break; // then all done
}
*(_pt+1) = 0; // Terminate the string
return ptr;
}
E-mail: info@telesys.ru