Jump to content
Tuts 4 You

[C++] char Error


Recommended Posts



I have no idea why this code won't compile. I get: error C2440: 'return' : cannot convert from 'char *' to 'const char' error. I compiled it before.

Can anyone take a look at the solution and try to fix the problem? It is only few KB is size and project is already created.

Thanks in advance!


Link to comment

static const char* FileNameOnly(char* aFileName)
char* pc = strrch r(aFileName, '\\');
if (pc)
return (const char*)(pc+1);
return (const char*)aFileName;
Edited by BoRoV
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...