#define STDC_WANT_LIB_EXT1 1
#include
#include
int main(void)
{
char str[] = "Enter enter the number hello world!";
char ch = 'e';
char *Got_char = str;
int count = 0;
while(Got_char = strchr(Got_char, ch))
{
++Got_char;
++count;
}
printf("这个字符串:\"%s\"中的关键字'%c'共出现%d次\n", str,ch,count);
return 0;
}
1.在这里为什么要使用str的地址并赋值给*Got_char?
2.Got _ char = strchr(Got_char, ch)是如何工作的?
3.为什么要递增count和Got_char?
望大神解惑!