Wandering between the native & managed world

CLR/.NET 4.0开发中~~

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

2008年11月29日

摘要: sizeof在非Unsafe环境下只能用于预定义的一系列类型,如Int,Short等等。而在Unsafe环境下,sizeof可以被用于值类型,但是值类型中不可以有引用类型,否则C#编译器会报错: error CS0208: Cannot take the address of, get the size of, or declare a pointer to a managed type ('Si... 阅读全文
posted @ 2008-11-29 22:33 张羿 阅读(427) 评论(0) 推荐(0) 编辑

摘要: 前几天写代码的时候遇到了一个十分诡异的编译错误。对于下面的代码,你能够发现问题在那里吗? 1: #define test(a, b, c) \ 2: a; \ 3: if (b) \ 4: c 编译器给出了下面这个错误信息: testdefine.cpp(8) : error C205... 阅读全文
posted @ 2008-11-29 22:27 张羿 阅读(416) 评论(0) 推荐(0) 编辑