In this function:
Code:
void FindDirectory(char *path)
{
...
char *pch;
pch = strrchr(path, '*');
memset(path, 'e', pch-path);
OR
memset(path, 'e', (int)pch-(int)path);
OR
path[pch-path] = 'e';
...
}
You've got three different methods that do three different things.
The third argument to memset() is the number of bytes to write at the location pointed to by the first argument. So you get something like:
Code:
char s[] = "string";
memset(s, 'e', 3);
puts(s); /* will print "eeeing" */
This is what your first memset() call is doing. Your second memset() call is not correct because you're casting pointers to ints. Don't do that. Subtracting pointers is perfectly valid in C (with the caveat that you can't subtract arbitrary pointers, but rather pointers that point inside the same object).
The last example you have will set just one character to 'e'. Namely, it will set the last '*' it finds to 'e'. If that's your goal, there is a clearer way to do it, if you weren't aware:
Code:
char *pch;
pch = strrchr(path, '*');
if(pch == NULL) return; /* your code should be doing something like this */
*pch = 'e';
"Clearer" because it's idiomatic.