#include <stdio.h> #include <string.h> int main(int argc, const char *argv[]) { char a[100] = "hello world"; char *s = NULL; s = strchr(a, 'd'); if (s != NULL) printf("%s\n", s); s = strstr(a, "wo"); printf("%s\n", s); return 0; } 测试结果