how to remove extension from file name?

Posted by alaamh on Stack Overflow See other posts from Stack Overflow or by alaamh
Published on 2010-04-29T11:09:12Z Indexed on 2010/04/29 11:17 UTC
Read the original article Hit count: 346

Filed under:
|

I want to throw the last three character from file name and get the rest?

I have this code:

char* remove(char* mystr) {

    char tmp[] = {0};
    unsigned int x;

    for (x = 0; x < (strlen(mystr) - 3); x++)
        tmp[x] = mystr[x];

    return tmp;
}

© Stack Overflow or respective owner

Related posts about c

    Related posts about file-extension