Preprocessor __FILE__ for Debugging

Hi,

Just wondering if it is possible to trim the file path output by __FILE__ preprocessor in my debugging line.

Let's say my main.cpp file is found in C:\User\MyName\SystemA\Mod1\SubMod2\Test\main.cpp

for __FILE__, I just want the filename - main.cpp to be printed, instead of the entire path + filename.

see Man Page for basename (Linux Section 3) - The UNIX and Linux Forums

That won't work inside C, frank_rizzo.

There's not another predefined variable for the name minus path, but you can 'cheat' by altering it with a #line directive:

#line 1 "filename.c"
// rest of file