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()
{
}
不花钱又能表达芳心,为对方设计情人节贺卡或者壁纸之类的,相信你的花心思制作的作品也能感动对方。...[详细]
- 视频教程:VC++从入门到精通07-10
- C#积木模块ABC(2)02-14
- C#积木模块ABC(1)02-14
- C#编程入门三部曲:第三步 增加响应用户02-14
- C#编程入门三部曲:第二步 向表单中增加02-14






