⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testclassconstructorimp.cpp

📁 computer clock codein c++,computer clock codein c++,computer clock codein c++,computer clock codein
💻 CPP
字号:
//Constructor with default values implementation file

#include <iostream>
#include "testClassConstructor.h"

using namespace std;

void testClass::print() const
{
	cout << "x = " << x << ", y = " << y << ", z = " << z
		 << ", ch = " << ch << endl;
}


testClass::testClass()	//default constructor
{
	x = 0;
	y = 0;
	z = 0;
	ch = '*';
}

testClass::testClass(int tX, int tY)
{
	x = tX;
	y = tY;
	z = 0;
	ch = '*';
}

testClass::testClass(int tX, int tY, double tZ)
{
	x = tX;
	y = tY;
	z = tZ;
	ch = '*';
}

testClass::testClass(double tZ, char tCh)
{
	x = 0;
	y = 0;
	z = tZ;
	ch = tCh;
}

⌨️ 快捷键说明

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