写一个C++测程序,
判断读出第三个斜杠后面的read-data
if(读取一行字符串,判断第三个斜杠后面的字符串,输出这个斜杠后面的字符串)
例如
test01/test02/test03/test04 读出的字符串为test04
写一个C++测程序,
判断读出第三个斜杠后面的read-data
if(读取一行字符串,判断第三个斜杠后面的字符串,输出这个斜杠后面的字符串)
例如
test01/test02/test03/test04 读出的字符串为test04
#include <stdio.h>
#include <string.h>
int main()
{
char *s = "test01/test02/test03/test04";
char *a = strchr(s, '/');
char *b = strchr(a+1, '/');
char *c = strchr(b+1, '/');
printf("%s\n", c+1);
return 0;
}