#include <stdio.h> void disk (char* path, char* dst)
{
while (*path != ':') {*dst++ = *path++;}
*dst = '\0';
}
void cat (char* path, char* dst)
{
char * first, * last;
while (*path != '\\') {path++;}
first = path;
while (*path != '\0') {if (*path++ == '\\') {last = path;}}
while (first < last) {*dst++ = *first++;}
*dst = '\0';
}
void name (char* path, char* dst)
{
char * slash;
while (*path != '\0') {if (*path++ == '\\') {slash = path;}}
while (*slash != '.') {*dst++ = *slash++;}
*dst = '\0';
}
void ext (char* path, char* dst)
{
char * dot;
while (*path != '\0') {if (*path++ == '.') {dot = path;}}
while (*dot != '\0') {*dst++ = *dot++;}
*dst = '\0';
}
int main () {
char buf [1024];
//void (*u) (char*, char*) = disk;
ext ("c:\\path\\folder\\directory\\temp.tmp", buf);
printf (buf);
return 0;
}