#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main() {
char s[]="hello";
//char ch = 'e';
char *p = strchr(s,e);
char c = *p;
printf("%s\n", c);
return 0;
}
运行以上代码报错:
改为:
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main() {
char s[]="hello";
char ch = 'e';
char *p = strchr(s,ch);
char c = *p;
printf("%s\n", c);
return 0;
}
就好了