#include <stdio.h>
char *FindLast(char *s, char c)
{
char *p, *p2 = 0;
for(p=s; *p; p++)
if (*p == c) p2 = p;
if (p2) p2++;
else if (c == '\\') return s;
return p2;
}
int main(int argc, char **argv)
{
char *name = "C:\\WINDOWS\\system32\\kernel32.dll";
//char *name = "kernel32.dll";
printf("%s %s %s\n", name, FindLast(name, '\\'), FindLast(name, '.'));
return 0;
}