当前位置:网站首页>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 .

边栏推荐
- TDengine 连接器上线 Google Data Studio 应用商店
- Texstudio tutorial
- How to pass array parameters in get request
- Using CMD to repair and recover virus infected files
- In depth cooperation | Taosi data cooperates with changhongjia Huawei customers in China to provide tdengine with powerful enterprise level products and perfect service guarantee
- SWT/ANR问题--当发送ANR/SWT时候如何打开binder trace(BinderTraces)
- Scheme of printing statistical information in log
- Research Report on the development trend and competitive strategy of the global facial wrinkle removal and beauty instrument industry
- SWT / anr problem - how to open binder trace (bindertraces) when sending anr / SWT
- sqlilabs less-11~12
猜你喜欢
![[零基础学IoT Pwn] 复现Netgear WNAP320 RCE](/img/f7/d683df1d4b1b032164a529d3d94615.png)
[零基础学IoT Pwn] 复现Netgear WNAP320 RCE
![[dynamic programming] interval dp:p1005 matrix retrieval](/img/c9/2091f51b905d2c0ebc978dab3d34d3.jpg)
[dynamic programming] interval dp:p1005 matrix retrieval

博文推荐 | 深入研究 Pulsar 中的消息分块

Minimum spanning tree and bipartite graph in graph theory (acwing template)

241. 为运算表达式设计优先级

sqlilabs less-8

Blog recommendation | in depth study of message segmentation in pulsar

2022 PMP project management examination agile knowledge points (6)

643. Maximum average number of subarrays I

Oracle-数据库对象的使用
随机推荐
Problem note - Oracle 11g uninstall
sqlilabs less-11~12
MIT team used graph neural network to accelerate the screening of amorphous polymer electrolytes and promote the development of next-generation lithium battery technology
光環效應——誰說頭上有光的就算英雄
Halo effect - who says that those with light on their heads are heroes
Pat 1121 damn single (25 points) set
Why did you win the first Taosi culture award of 20000 RMB if you are neither a top R & D expert nor a sales Daniel?
"National defense seven sons" funding soared, with Tsinghua reaching 36.2 billion yuan, ranking second with 10.1 billion yuan. The 2022 budget of national colleges and universities was made public
Provincial election + noi Part VIII fraction theory
Is the futures company found on Baidu safe? How do futures companies determine the regularity
sqlilabs less9
问题随记 —— Oracle 11g 卸载
Basis of target detection (NMS)
用对场景,事半功倍!TDengine 的窗口查询功能及使用场景全介绍
对于编程思想和能力有重大提升的书有哪些?
C 语言基础
SQLAchemy 常用操作
Word2vec yyds dry goods inventory
Build your own website (14)
NPDP产品经理国际认证报名有什么要求?