Re: macro to print filename
"Michal Nazarewicz" <[email protected]> Wed, 01 Jun 2011 19:38:32 +0200
| Newsgroups | org.kernel.vger.linux-c-programming |
|---|---|
| Message-ID | <op.vweraiul3l0zgt@mnazarewicz-glaptop> |
On Wed, 01 Jun 2011 18:07:42 +0200, ratheesh kannoth <[email protected]> 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: [email protected]>-----ooO--(_)--Ooo--