12. Write a function that finds the last instance of a character in a string
char *lastchar(char *String, char ch)
{
char *pStr = NULL; // traverse the entire string while( * String ++ != NULL )
{
if( *String == ch )
pStr = String;
}
return pStr;
}
No comments:
Post a Comment