#include <stdio.h> char *fdl(char *str) { char *q=NULL,*p;/*q就是所找字符的指针,找之前其值为NULL */ for(p=str;p!='\0';[++) if(*p>='a' && *p<='z'){q=p;break;} return q;/*将所求的指针返回*/ } main() { char ps[30]; char *x; x=fdl(ps); if(x!=NULL) { printf("The first chr is %c\n",*x); } else printf("Do not find char\n"); getchar(); }