CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2006
    Posts
    384

    Understanding Backslash and Yen

    Hi,

    I have often noticed that on Windows, when I intend to type in a folder separator \ (backslash), it gets displayed as the yen symbol.

    Why does this happen ? Could you please explain.

  2. #2
    Join Date
    Feb 2005
    Posts
    2,160

    Re: Understanding Backslash and Yen

    Backslash is an flag character in C/C++ character arrays. It tells the compiler to do something special at that point in a string:

    Code:
      char foo[]="Insert a tab here\t.";
    To use a literal '\', just type it twice:

    Code:
      char bar[]="c:\\Temp";

  3. #3
    Join Date
    Feb 2009
    Location
    India
    Posts
    444

    Re: Understanding Backslash and Yen

    This happens when you install the Japanese code page and set it as the default locale.

    Read more about it here -
    Backslash
    When is a backslash not a backslash?
    «_Superman
    I love work. It gives me something to do between weekends.

    Microsoft MVP (Visual C++)

  4. #4
    Join Date
    Feb 2005
    Posts
    2,160

    Re: Understanding Backslash and Yen

    Interesting read. I was way off. Sorry. I should have noticed that with 300+ posts, the OP must surely know about backslash escapes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured