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

📄 选做.cpp

📁 c++模板小实验
💻 CPP
字号:
#include<iostream.h>
#include<string.h>
class people
{
public:
    char id[11];
	people(char i[11])
	{
		strcpy(id,i);
	}
	people operator==(people &m)
	{
    	if (strcmp(id,m.id)==0)
		{
			cout<<"相等"<<endl;
		}
		cout<<"不等"<<endl; 
		return *this;
	} 
	people operator=(people &n)
	{
		strcpy(id,n.id);
		return *this;
	}
	void print()
	{
		cout<<"id为"<<id<<endl;
	}
};
void main()
{  
	people b("198123");
    people a("198213");
	a==b;
	b.print();
	people c("198210");
	a=c;
	a.print();


}

⌨️ 快捷键说明

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