📄 myclass.cpp
字号:
// MyClass.cpp: implementation of the MyClass class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "MyClass.h"
#include <iostream.h>
#include <stdlib.h>
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
MyClass::MyClass( int i )
{
p = new int;
if ( !p )
{
cout << "Allocation error\n";
exit(1);
}
*p = i;
}
MyClass::~MyClass()
{
delete p;
}
#if _SONGK_USE_CP_CTOR_
MyClass::MyClass( const MyClass& obj )
{
if ( p != NULL )
{
delete p;
p = NULL;
}
p = new int;
if (!p)
{
cout << "Allocation error\n";
exit(1);
}
*p = *obj.p;
}
#endif
int GetVal( MyClass obj )
{
return *obj.p;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -