Answers

Question and Answer:

  Home  Programming Algorithms

⟩ 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;

}

 200 views

More Questions for you: