Programming Life

.NET World

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

2008年7月6日

摘要: 先看下面的代码: 1ref class Point 2{ 3public: 4 int X; 5 int Y; 6}; 7 8void main() 9{ 10 Point^ p1 = gcnew Point(); 11 p1->X = 1; 12 Point p2; 13 p2.X = 2; 14} 我们知道在.NET中,值类型与引用类型的区... 阅读全文
posted @ 2008-07-06 15:14 许文科 阅读(502) 评论(0) 推荐(0) 编辑

摘要: 先看下面的C#代码,能编译通过吗?为什么? using System; public class Component { private int context; public Component(Component component) { component.context = 1; } } 答案是可以的... 阅读全文
posted @ 2008-07-06 14:05 许文科 阅读(554) 评论(1) 推荐(0) 编辑

摘要: 这里列举了一些我认为C++/CLI编程的需要知道一些基本概念 非安全代码(Unsafe code):一般而言,用VB.NET, C#编译成的代码是安全代码,这里的安全是指编译器本身的能力而言。比如对同样的一个C#程序,如果使用/unsafe选项进行编译的话,会产生如下的directive: .assembly assemblyNameXXX { // 涉及到安全许可时,忽略代码校验 .perm... 阅读全文
posted @ 2008-07-06 11:51 许文科 阅读(2819) 评论(2) 推荐(0) 编辑

摘要: C++中的enum与.net中的enum类型比较 阅读全文
posted @ 2008-07-06 11:17 许文科 阅读(3750) 评论(7) 推荐(0) 编辑