-
__FILE__ Predefined Macro
when I use it in my program to display file name it displays complete path
like
C:\Windows\Desktop\Project\FuzzyLogic\Fuzzy.cpp
I'm willing to display "Fuzzy.cpp" and not the complete path. Any idea?
-
Re: __FILE__ Predefined Macro
"john_trivolta" <john_trivolta@planetaccess.com> wrote:
>
>when I use it in my program to display file name it displays complete path
>
>like
>
>C:\Windows\Desktop\Project\FuzzyLogic\Fuzzy.cpp
>
>I'm willing to display "Fuzzy.cpp" and not the complete path. Any idea?
>
If you mean by "display" you just want to print out the file name you can
do something like this...
char* pc = strrchr(__FILE__, '\\');
printf("This file is %s\n", pc + 1);
string sFile(pc + 1);
cout << sFile << endl;
If you want to change the behavior of the predefined macro then you are probably
out of luck.
-
Re: __FILE__ Predefined Macro
Thank you Ralph ! I was looking for the display purpose only.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks