输入输出流运算重载模板
来源:互联网 发布:安卓版cad软件 编辑:程序博客网 时间:2024/05/21 08:39
// 输入输出流运算重载模板
#include <iostream>
class Test {
private:
int testMenber1;
double testMenber2;
public:
friend std::istream &operator >>(std::istream &stream, Test &temp) {
std::cin >> temp.testMenber1 >> temp.testMenber2;
return stream;
}
friend std::ostream &operator <<(std::ostream &stream, Test &temp) {
std::cout << "menber1 = " << temp.testMenber1 <<"\nmenber2 = " << temp.testMenber2 << std::endl;
return stream;
}
};
int main(int argc,const char *argv[]) {
Test tt;
std::cin >> tt;
std::cout << tt;
return0;
}
0 0
- 输入输出流运算重载模板
- 重载运算符和输入输出流
- C++重载运算符和输入输出流
- C++ 流输入输出运算符重载
- 输入输出运算符重载
- 重载输入输出运算符
- 输入输出运算符重载
- 输入输出运算符重载
- 输入输出运算符重载
- 【模板类中重载输入输出流 】
- C++重载输入输出运算符
- C++输入输出运算符重载
- C++输入输出运算符重载
- C++输入输出运算符重载
- C++ 输入输出运算符重载
- C++ 输入输出运算符重载
- C++输入输出运算符重载
- 输入输出运算符的重载
- Animation动画详解(四)——ValueAnimator基本使用
- redis基本命令学习
- 博客永久迁移
- Mysql分库分表方案
- 数据库水平切分的实现原理解析---分库,分表,主从,集群,负载均衡器
- 输入输出流运算重载模板
- DataTable判断某个字段是否有重复数据、数组去重复。
- 分库分表带来的完整性和一致性问题
- 数据库表扩展 扩展属性
- netstat命令
- GPS数据读取与处理
- Volley 使用说明
- Cacti完全使用手册 ( 让你快速个性化使用Cacti )
- 关于initrd.img的压缩(制作)及解压的过程