Re: String concatination
- From: "Rodrigo Corral [MVP]" <corral_glez@xxxxxxxxxxx>
- Date: Wed, 4 May 2005 18:52:04 +0200
There is not operator + in the string class.
When you write code like
string a = "A";
string b = "B";
string c = a + b;
the C# compiler is who translates this code in a call to the Concat string's
member function.
Here is the IL code:
..method private hidebysig static void Main(string[] args) cil managed
{
.entrypoint
// Code Size: 21 byte(s)
.maxstack 2
.locals (
string text1,
string text2,
string text3)
L_0000: ldstr "A"
L_0005: stloc.0
L_0006: ldstr "B"
L_000b: stloc.1
L_000c: ldloc.0
L_000d: ldloc.1
L_000e: call string string::Concat(string, string)
L_0013: stloc.2
L_0014: ret
}
The C++ compiler doesn't do this magic ;).
--
Un saludo
Rodrigo Corral González [MVP]
FAQ de microsoft.public.es.vc++
http://rcorral.mvps.org
.
- References:
- String concatination
- From: Boni
- String concatination
- Prev by Date: Re: String concatination
- Next by Date: How turn off memory leak dumping?
- Previous by thread: Re: String concatination
- Next by thread: Re: security_cookie unresolved symbol
- Index(es):
Relevant Pages
|