Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9172555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:22:33+00:00 2026-06-17T16:22:33+00:00

One may generally use __LINE__ and __FILE__ in C++ programs, with many toolchains, including

  • 0

One may generally use __LINE__ and __FILE__ in C++ programs, with many toolchains, including GCC.

__LINE__ under GCC evaluates to an expression of type int;
__FILE__ evaluates to a char const[N] where N is the appropriate value.

  • Does any major toolchain provide an equivalent to __FILE__ with type wchar const[N]?
  • If so, what is it?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T16:22:34+00:00Added an answer on June 17, 2026 at 4:22 pm

    You can make your own WFILE:

    #define WIDE2(x) L##x
    #define WIDE1(x) WIDE2(x)
    #define WFILE WIDE1(__FILE__)
    

    Tested with non-ASCII characters and filename 马克.cpp:

    #include <stdio.h>
    #include <io.h>
    #include <fcntl.h>
    
    #define WIDE2(x) L##x
    #define WIDE1(x) WIDE2(x)
    #define WFILE WIDE1(__FILE__)
    
    int main() {
        _setmode(_fileno(stdout), _O_U16TEXT); // required for Unicode output to console
        wprintf(L"%s\n", WFILE);
    }
    

    Demo (running from cmd.exe and Chinese language support installed):

    C:\>cl /W4 /nologo 马克.cpp
    马克.cpp
    
    C:\>马克.exe
    马克.cpp
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider a table products which has product details including its category. One product may
When we want to modify some value in one object we may use two
Okay, so this one may be difficult but I will do my best to
How may one get information that was used to programatically generate asp controls? For
On day one I may receive large CSV output such as: this,is,a,test bob,is,your,uncle sound,one,Zen
Let's say my HTML may look one of two ways: Option 1: <h2>My header
I've come across a tutorial (reputable one if I may add) where the closing
I have an object whose value may be one of several array types like
I have a collection of static libraries (.lib) files one of which may have
I have the following String Sample however in some occurences there may be one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.