C语言截取 .txt

void getEnderName(char *src, char *ender)
{
    int iLen;
    char s[100]={0};
    char s1[100]={0};

    iLen = strlen(src);
		
    while(src[iLen--] != '.')
    {}

    strncpy(s, src+iLen+2, 20);
    //printf("%s\n", s);
    sprintf(s1, ".%s", s);
    strcpy(ender, s1);
}

你可能感兴趣的:(C语言)