SUMTEC -- There's a thing in my bloglet.

But it's not only one. It's many. It's the same as other things but it exactly likes nothing else...

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::

2004年10月27日

摘要: 假设我有一个object类型的变量o,需要转化成string类型的变量s。那么请问下列方式当中的那一个方案更加有效率:1、 s = (string) o;2、 s = o.ToString();相关提示:1、(string) 强制转换对应一句IL语句castclass,在IL中大概表现为: L_0019: ldloc.0 L_001a: castclass string ... 阅读全文
posted @ 2004-10-27 16:30 Sumtec 阅读(1232) 评论(5) 推荐(0)

摘要: 今天在做一个实验,突然发现一个不寻常的地方:VS2k5 C# 在编译for循环的时候,IL代码跟以前的方式不一样: L_0029: ldloc.1 L_002a: ldc.i4 100000000 L_002f: clt L_0031: stloc.s flag1 L_0033: ldloc.s flag1 L_0035: brtru... 阅读全文
posted @ 2004-10-27 16:09 Sumtec 阅读(1125) 评论(0) 推荐(0)