wshm1979

wshm1979

  • NA
  • 3
  • 0

About boxing

Nov 2 2004 7:48 PM
Please look at this code: string s=10.ToString(); , Is number '10' boxed?There is the IL code for this code: .locals init (string V_0, int32 V_1) IL_0000: ldc.i4.s 10 IL_0002: stloc.1 IL_0003: ldloca.s V_1 IL_0005: call instance string [mscorlib]System.Int32::ToString() IL_000a: stloc.0 IL_000b: ret It seemed that no boxing occured. But i am not clear what happened to deal with the code "10.ToSring()", Can you help me to explain that, thanks!

Answers (2)