Tutorials, Free Online Tutorials,It Challengers provides tutorials and interview questions of all technology like java tutorial, android, java frameworks, javascript, core java, sql, php, c language etc. for beginners and professionals.

Breaking

12. Write a function that finds the last instance of a character in a string


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