写了个小程序,了解一下C的字符串搜索函数strstr()是怎么处理空串的。 程序 #include <stdio.h> #include <string.h> // 在字符串`s`中搜索`p`, const char *s[] = { "abcd", ""}; const char *p[] = { "b", "A"