memory.cpp

来自「Windows CE上的计算器」· C++ 代码 · 共 62 行

CPP
62
字号
//////////////////////////////////////////////////////////////////////
//
// Memory.cpp: implementation of the CMemory class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "memory.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

const long double kZero=0.0;
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

//initialization
CMemory::CMemory()
{
	bStored=FALSE;
	mData=kZero;
}

CMemory::~CMemory()
{
	//Do Nothing..
}
//MR
long double CMemory::Read()
{
	return mData;
}
//MS
void CMemory::Save( long double data )
{
	if (data)
	{
		mData=data;
		bStored=true;
	}
}
//MC
void CMemory::Clear()
{
	mData=kZero;
	bStored=false;
}
//M+
void CMemory::Add( long double inData )
{
	mData+=inData;
	bStored=true;
}

bool CMemory::isStored()
{
	return bStored;	
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?