L”” or to “” Strings
-
When you see System::String used with “xxx” in some text or example you almost always see the ‘L’ macro in from of the text (L”xxx”). However if I do not use the ‘L’, It seems to have no affect to my String values. Am I missing something?
String ^MyText = "Blah";
//or
String ^MyOtherText = L"Blah";Same right?
Programmer Glenn Earl Graham Austin, TX
-
When you see System::String used with “xxx” in some text or example you almost always see the ‘L’ macro in from of the text (L”xxx”). However if I do not use the ‘L’, It seems to have no affect to my String values. Am I missing something?
String ^MyText = "Blah";
//or
String ^MyOtherText = L"Blah";Same right?
Programmer Glenn Earl Graham Austin, TX
I don't agree with my own reply :) I think the compiler now automatically uses the appropriate type when it knows the context. String ^MyText = "Blah"; The literal "Blah" ends up in the assembly metadata as a CString^, just as using the 'S' prefix did in VS2003. hmm - maybe I need to look in the MSIL to see if there's a difference :) Mark -- modified at 15:55 Monday 16th July, 2007
Mark Salsbery Microsoft MVP - Visual C++ "Great job team! Head back to base for debriefing and cocktails."
-
I don't agree with my own reply :) I think the compiler now automatically uses the appropriate type when it knows the context. String ^MyText = "Blah"; The literal "Blah" ends up in the assembly metadata as a CString^, just as using the 'S' prefix did in VS2003. hmm - maybe I need to look in the MSIL to see if there's a difference :) Mark -- modified at 15:55 Monday 16th July, 2007
Mark Salsbery Microsoft MVP - Visual C++ "Great job team! Head back to base for debriefing and cocktails."
-
Cool! Thanks for saving me the time ;) Cheers! Mark
Mark Salsbery Microsoft MVP - Visual C++ "Great job team! Head back to base for debriefing and cocktails."
-
I don't agree with my own reply :) I think the compiler now automatically uses the appropriate type when it knows the context. String ^MyText = "Blah"; The literal "Blah" ends up in the assembly metadata as a CString^, just as using the 'S' prefix did in VS2003. hmm - maybe I need to look in the MSIL to see if there's a difference :) Mark -- modified at 15:55 Monday 16th July, 2007
Mark Salsbery Microsoft MVP - Visual C++ "Great job team! Head back to base for debriefing and cocktails."
Mark Salsbery wrote:
String ^MyText = "Blah"
Hi, What this "^" cap symbol represents? where it is useful?
Nice talking to you. :-O
If you judge people, you have no time to love them. -- Mother Teresa -
Mark Salsbery wrote:
String ^MyText = "Blah"
Hi, What this "^" cap symbol represents? where it is useful?
Nice talking to you. :-O
If you judge people, you have no time to love them. -- Mother Teresa