/ Published in: C

for cmdparsing
Expand |
Embed | Plain Text
/* ------------------------------------------------------------------------------- *\ | # get_filename_from_path : searches a given filepath for its name | | @param : char* to the existing filepath | | @return : char* to the found filename | \* ------------------------------------------------------------------------------- */ char* get_filename_from_path(char* filepath) { char *filename = (char*)calloc(1, sizeof(SIZE_FILENAME)); filename = (strrchr(filepath, '/'))+1; return filename; }
You need to login to post a comment.