C语言 寻找字符串的第一个小写字母

#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();
}

http://www.pythonschool.com/python/11.html 转摘

原文地址:https://www.cnblogs.com/pythonschool/p/2729292.html