废话少说,直接上代码:
- #include <iostream>
- using namespace std;
-
- int main()
- {
- char str[100] = "a^bcddd^xyz^wasldg";
- char *p = strrchr(str, '^');
-
-
- if(NULL != p)
- {
- p = p + 1;
-
- cout << p << endl;
- }
- else
- {
- cout << "no" << endl;
- }
-
- return 0;
- }
结果为:wasldg

![[手游] 三网H5小游戏【少年仙路】WIN系服务端+Linux手工服务端+详细搭建教程](https://cdn.jxasp.com:9143/image/20260615/136BC33AA47EB0D84E878835A8B38FDB.png)

















