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

边栏推荐
- Don't want to knock the code? Here comes the chance
- Research Report on the development trend and competitive strategy of the global indexable milling cutter industry
- Go integrates logrus to realize log printing
- Fundamentals of C language
- 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
- [getting started with Django] 13 page Association MySQL "multi" field table (check)
- 2022-2-15 learning the imitation Niuke project - Section 3 post details
- Tdengine connector goes online Google Data Studio app store
- Use the right scene, get twice the result with half the effort! Full introduction to the window query function and usage scenarios of tdengine
- Research Report on the development trend and competitive strategy of the global axis measurement system industry
猜你喜欢

How can we protect our passwords?
![[IOT design. Part I] stm32+ smart cloud aiot+ laboratory security monitoring system](/img/a0/2654d43cfb6a135cc15d84447a13f9.png)
[IOT design. Part I] stm32+ smart cloud aiot+ laboratory security monitoring system

JVM performance tuning and practical basic theory part II

phpcms实现订单直接支付宝支付功能

Leetcode(69)——x 的平方根

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?

手把手带你入门 API 开发

643. Maximum average number of subarrays I

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

Logic is a good thing
随机推荐
使用net core 6 c# 的 NPOI 包,讀取excel..xlsx單元格內的圖片,並存儲到指定服務器
那个很努力的学生,高考失败了……别慌!你还有一次逆袭机会!
Is it reasonable and safe for securities companies to open accounts for 10000 free securities? How to say
sqlilabs less10
Build your own website (21)
Research Report on the development trend and competitive strategy of the global commercial glassware industry
深度合作 | 涛思数据携手长虹佳华为中国区客户提供 TDengine 强大企业级产品与完善服务保障
[dynamic programming] p1004 grid access (four-dimensional DP template question)
Salesforce、约翰霍普金斯、哥大 | ProGen2: 探索蛋白语言模型的边界
【阶段人生总结】放弃考研,参与到工作中,已经顺利毕业了,昨天刚领毕业证
当主程架构游戏的时候,防止到处调用减少耦合性,怎么开放接口给其他人调用呢?
C#学习笔记(5)类和继承
Scheme of printing statistical information in log
问题随记 —— Oracle 11g 卸载
MIT团队使用图神经网络,加速无定形聚合物电解质筛选,促进下一代锂电池技术开发
[getting started with Django] 13 page Association MySQL "multi" field table (check)
对于编程思想和能力有重大提升的书有哪些?
从零开发小程序和公众号【第三期】
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
Details of appium key knowledge