2019.5.17

2019.5.17

char* find_format(const char format[]){
    char* p;
    char* q;

    p = strchr(format, '%');
    while(p != NULL && *(p+1) == '%'){
        p = strchr(p+2,, '%');
    }

    if(p == NULL) return NULL;
    p++;
    q = strchr(p, '%');
    while(q != NULL && *(q+1) == '%'){
        q = strchr(q+2, '%');
    }
    if(q != NULL) return NULL;
    q = p + strspn(p, " -0+#");
    q += strspn(q, "0123456789");

    if(*q == '.'){q++; q+= strspn(q, "0123456789");}
    if( strchr("eEfFgG", *q) == NULL) return NULL;
    return p;
}

2019.5.17_第1张图片

你可能感兴趣的:(琉璃神社)