#include <stdio.h>
#include <string.h>
int main()
{
char* str = "sdfgbgtr";
char* s = "fgb";
char *res = strstr(str, s);
int pos = res - str;
printf("%d\n", pos); // 打印 2
}
#include <stdio.h>
#include <string.h>
int main()
{
char* str = "sdfgbgtr";
char* s = "fgb";
char *res = strstr(str, s);
int pos = res - str;
printf("%d\n", pos); // 打印 2
}