I am working with a program that needs to trim the path name down to just the filename. I am using windows. This input is coming from a predetermined value in the registry. I was wondering what the best method of doing this would be.
The method that I think would be the easiest would be this way:
Unfortunately I get:
//This approaches the first back slash from the right side of the string
for (i = strlen(sTemp); i > 0; i--)
if (sTemp[i-1] == '\\')
This seems to be a good way to do it, but apparently I am confusing on what format to send my arguments to strcpy. Or maybe I should be using an entirely different function.
Error 1 error C2664: 'strcpy' : cannot convert parameter 2 from 'char' to 'const char *