What does "L" in front of string mean?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: What does "L" in front of string mean?

  1. #1
    Join Date
    Nov 2008
    United States

    What does "L" in front of string mean?

    I used Visual C++ Express 2005 and seen this code.

    this->Name = S"Form1";

    Now I am using Visual C++ Express 2008 and I see this code.

    this->Name = L"Form1";
    I do not understand what the "S" and "L" are used for. I use C# mainly and have never seen this before. I searched on the Internet and found some examples. I read two articles about wide-character literals or something similar.

    Neither of the articles made any since to me. I'm more confused now then I was before I read them.

    Why do I need those characters in front of my strings, and what happens if I don't use them?

    I think this might even be a Managed C++ issue, but I'm not sure where it fits.
    Using: MS C# 08 EE, MS SQL 05 EE, C++ .Net 08 EE, Vista Home Premium, XP Home

  2. #2
    Join Date
    Mar 2002
    St. Petersburg, Florida, USA

    Re: What does "L" in front of string mean?

    They are used to control UNICODE with respect to literals.

    Start here
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

Posting Permissions

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

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)