November 29th, 2008, 11:49 AM
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.
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.
this->Name = L"Form1";
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
November 29th, 2008, 12:34 PM
Re: What does "L" in front of string mean?
They are used to control UNICODE with respect to literals.
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
In theory, there is no difference between theory and paractice; in practice there is.
* Join the fight, refuse to respond to posts that contain code
outside of [code] ... [/code]
tags. See here
* How NOT
to post a question here
* Of course you read this
carefully before you posted
* Need homework help? Read this first
Click Here to Expand Forum to Full Width