当前位置:网站首页>Rearrangement of overloaded operators
Rearrangement of overloaded operators
2022-07-01 14:37:00 【Take you to learn code】
#include<iostream>
using namespace std;
class a
{
public:
a(int year1,int month1,int day1){year=year1;month=month1;day=day1;}
friend ostream&operator <<(ostream&output,a&b);
private:
int year,month,day;
};
ostream&operator <<(ostream&output,a&b)
{
output<<b.year<<" year "<<b.month<<" month "<<b.day<<" Japan ";
return output;
}
int main()
{
a b(2022,6,29);
cout<<b;
}
Can be combined with a parametric constructor , Directly pass parameters to construct relevant functions .

边栏推荐
- Pat 1065 a+b and C (64bit) (20 points) (16 points)
- [R language data science]: common evaluation indicators of machine learning
- sqlilabs less10
- Research Report on the development trend and competitive strategy of the global aviation leasing service industry
- [Verilog quick start of Niuke question series] ~ use functions to realize data size conversion
- [零基础学IoT Pwn] 复现Netgear WNAP320 RCE
- 百度上找的期货公司安全吗?期货公司怎么确定正规
- sqlilabs less-8
- 微服务开发步骤(nacos)
- The integration of computing and Internet enables the transformation of the industry, and the mobile cloud lights up a new roadmap for the future of digital intelligence
猜你喜欢

sqlilabs less10

Today, with the popularity of micro services, how does service mesh exist?

Using CMD to repair and recover virus infected files

那个很努力的学生,高考失败了……别慌!你还有一次逆袭机会!

Don't want to knock the code? Here comes the chance

111. Minimum depth of binary tree
![[getting started with Django] 13 page Association MySQL](/img/78/cbf88ae3c3d311edd7d9af8c985749.jpg)
[getting started with Django] 13 page Association MySQL "multi" field table (check)

MIT team used graph neural network to accelerate the screening of amorphous polymer electrolytes and promote the development of next-generation lithium battery technology

2022 PMP project management examination agile knowledge points (6)

sqlilabs less13
随机推荐
Research Report on the development trend and competitive strategy of the global navigation simulator industry
Halo effect - who says that those with light on their heads are heroes
一波三折,终于找到src漏洞挖掘的方法了【建议收藏】
力扣解法汇总241-为运算表达式设计优先级
Après avoir été licencié pendant trois mois, l'entrevue s'est effondrée et l'état d'esprit a commencé à s'effondrer.
户外LED显示屏应该考虑哪些问题?
Research Report on the development trend and competitive strategy of the global pipeline robot inspection camera industry
WebSocket(简单体验版)
当主程架构游戏的时候,防止到处调用减少耦合性,怎么开放接口给其他人调用呢?
Buuctf reinforcement question ezsql
Yyds dry goods inventory hcie security day13: firewall dual machine hot standby experiment (I) firewall direct deployment, uplink and downlink connection switches
How can we protect our passwords?
Websocket (simple experience version)
Logic is a good thing
Research Report on the development trend and competitive strategy of the global facial wrinkle removal and beauty instrument industry
One of the data Lake series | you must love to read the history of minimalist data platforms, from data warehouse, data lake to Lake warehouse
sqlilabs less9
Provincial election + noi Part XI others
光环效应——谁说头上有光的就算英雄
Word2vec yyds dry goods inventory