1、strstr:查找字符串子串函数,查找到的子串中第一个字符的地址,返回值是第一次出现子串字符串的位置。
例如:
char a[20] = "RUNOOB";
char b[10] = "NOOB";
printf("%s", strstr(a, b));
在这里子串就是b,b的第一个字符是N,在a里面的地址是2,所以strstr的返回值就是a+2作为首地址输出这个字符串,输出就是NOOB,如果a的后面还有字符串的话也是会被输出出来的。


2、strcat:将字符串进行拼接
例如
//第二题
char a1[80], a2[80], *s1 = a1, *s2 = a2;
gets_s(s1,10); gets_s(s2, 10);
if (!strcmp(s1, s2))
printf("*");
else printf("#");
printf("%d", strlen(strcat(s1, s2)));
定义字符串a1,a2。s1是一个指针,指向字符数组a1,s2指向a2,终端输入book回车,book(空格)回车之后,比较两个数组是不是相等,strcmp返回的是-1,!返回0,所以最终输出#9
