C#高级特性课件.pptVIP

  • 46
  • 0
  • 约7.94千字
  • 约 52页
  • 2016-12-22 发布于浙江
  • 举报
4.6 C#语言中的其他成分 编译预处理 1.标识符声明 #define定义一个标识符; #undef“取消定义”一个标识符。 2.条件处理 #if, #elif, #else, #endif 3.信息报告 #error 和 #warning 4.行号标记 #line 行号 文件名 unsafe及指针 1.unsafe 用于修饰类、方法等 2.fixed及指针 fixed( 类型 * 指针名 = 表达式 ) 语句 3.sizeof运算符 sizeof( 简单或结构类型名 ) 4.stackalloc 在栈上分配的内存,而不是在堆上,因此不会担心内存被垃圾回收器自动回收。 UnsafeCopy.cs C# And Pointers Developers sometime need total control Performance extremes Dealing with existing binary structures Advanced COM Support, DLL Import C# “unsafe” = a limited “inline C” Pointer types, pointer arithmetic Unsafe casts Declarative pinning (fixed statement) C# developers hav

文档评论(0)

1亿VIP精品文档

相关文档