1
2
3
4
5
6
7
8
9
10
11
12
13
14 |
#include <string.h> #include <stdio.h> int main( void ) { char
string[20]; char
*ptr, c = ‘r‘ ; strcpy (string, "There are two rings" ); ptr = strrchr (string, c); if
(ptr) printf ( "The character %c is at position: %s\n" , c, ptr); else printf ( "The character was not found\n" ); return
0; } |
原文:http://www.cnblogs.com/liulipeng/p/3553032.html