System.Type类持有"IsPointer“属性的主要原因是什么?
我读到它可以用作"Isprimitive“来检查类型是否是原语。对吗?
发布于 2011-11-15 15:29:23
primitive types包括Boolean、Byte、SByte、Int16、UInt16、Int32、UInt32、Int64、UInt64、Char、Double和Single。
IsPointer -指示类型是否为指针。即使在不安全的block中的C#中也可以声明指针调用
unsafe struct Node
{
public Node* NextNode;
}发布于 2011-11-15 15:42:13
引用MSDN的话
Type.IsPointer属性-获取一个值,该值指示Type是否为指针。
Type.IsPrimitive属性-获取一个值,该值指示Type是否为基元类型之一。
https://stackoverflow.com/questions/8132730
复制相似问题