I do not think this can be done in *compiling* time, neither macro in c nor template in c++, so would you be so kind to offer the solution by using template or just give some tips? Since I'm not that good at c++ :) On Thu, Jun 2, 2011 at 01:38, Michal Nazarewicz <mina86@xxxxxxxxxx> wrote: > On Wed, 01 Jun 2011 18:07:42 +0200, ratheesh kannoth > <ratheesh.ksz@xxxxxxxxx> wrote: >> >> __FILE__ macro prints relative path name of the file. > > Not prints but expands to but we know what you mean. ;) > >> I need only filename. How to extract this? >> >> I don't want to use any string library - since it includes more >> Processing and needs to store the character array in executable. >> Is there any method at preprocessing level to do this. > > I can say with 99,9% confidence that there is no such thing in C > standard and 99% that there is no such thing in GCC. > > You probably can do that in C++ with templates if that's any > constellation. > > -- > Best regards,                     _   _ > .o. | Liege of Serenely Enlightened Majesty of   Âo' \,=./ `o > ..o | Computer Science, ÂMichal "mina86" Nazarewicz  Â(o o) > ooo +-----<email/xmpp: mnazarewicz@xxxxxxxxxx>-----ooO--(_)--Ooo-- > -- > To unsubscribe from this list: send the line "unsubscribe > linux-c-programming" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at Âhttp://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html