C++类机制的实现细节

出处:CSDN 2004年04月23日 作者:nightsuns 责任编辑:linjixiong

文章导读:  为了搞清楚VC中类的实现专门写了一个最简单的类,用来观察它的实现过程,代码如下:  // test.cpp : Defines the entry point for the console application.  //    #include "stdafx.h"  #include "CTest.h"      int main(int argc, char* argv[])  {  

  为了搞清楚VC中类的实现专门写了一个最简单的类,用来观察它的实现过程,代码如下:
  // test.cpp : Defines the entry point for the console application.
  //
  


  #include "stdafx.h"
  #include "CTest.h"
    
  int main(int argc, char* argv[])
  {
  CTest aTest;
  aTest.a(1,2);
  return 0;
  }
  
  // CTest.h: interface for the CTest class.
  //
  //////////////////////////////////////////////////////////////////////
  
  #if !defined(AFX_CTEST_H__2CCCDCFC_6C3A_48BC_9CD0_E7A8E63431D9__INCLUDED_)
  #define AFX_CTEST_H__2CCCDCFC_6C3A_48BC_9CD0_E7A8E63431D9__INCLUDED_
  
  #if _MSC_VER > 1000
  #pragma once
  #endif // _MSC_VER > 1000
  
  class CTest 
  {
  public:
  CTest();
  virtual ~CTest();
  
  public:
  void b();
  void a(int one,int two);
  };
  
  #endif // !defined(AFX_CTEST_H__2CCCDCFC_6C3A_48BC_9CD0_E7A8E63431D9__INCLUDED_)
  
  
  // CTest.cpp: implementation of the CTest class.
  //
  //////////////////////////////////////////////////////////////////////
  
  #include "stdafx.h"
  #include "CTest.h"
  
  //////////////////////////////////////////////////////////////////////
  // Construction/Destruction
  //////////////////////////////////////////////////////////////////////
  
  CTest::CTest()
  {
  
  }

相关快问问题
频道精选

爱很简单!教您DIY制造浪漫

爱很简单!教您DIY制造浪漫

不花钱又能表达芳心,为对方设计情人节贺卡或者壁纸之类的,相信你的花心思制作的作品也能感动对方。...[详细]

本周十大热评文章
本周十大人气文章
壁纸图赏