托管C++探索01-数据类型

来源:互联网 发布:608所怎么样 知乎 编辑:程序博客网 时间:2024/05/17 08:31

托管C++(以下简称C++/CLI)兼容标准C++的数据类型,在托管类内定义这些数据类型将转换为另一中形式。

public __gc class Test{  // TODO: 在此添加此类的方法。private:  bool m_bool;  int m_int;  long m_long;      char m_char;  short m_short;  float m_float;  double m_double;  unsigned int m_unsigned_int;  unsigned long m_unsigned_long;      unsigned char m_unsigned_char;  unsigned short m_unsigned_short;};

使用Reflector反编译的代码:

public __gc class Test{  // Methods  public: Test();  // Fields  private: Boolean __gc* m_bool;  private: SByte __gc* modopt(NoSignSpecifiedModifier __gc*) m_char;  private: Double __gc* m_double;  private: Single __gc* m_float;  private: Int32 __gc* m_int;  private: Int32 __gc* modopt(IsLongModifier __gc*) m_long;  private: Int16 __gc* m_short;  private: Byte __gc* m_unsigned_char;  private: UInt32 __gc* m_unsigned_int;  private: UInt32 __gc* modopt(IsLongModifier __gc*) m_unsigned_long;  private: UInt16 __gc* m_unsigned_short;};


原创粉丝点击