《C++捷径教程》读书笔记--Chapter 18--C++的I/O系统--1
2006-10-15 22:18
399 查看
//--《C++捷径教程》读书笔记--Chapter 18--C++的I/O系统
//--Chapter 18--C++的I/O系统
//--10/15/2006 Sun.
//--Computer Lab
//--Liwei
//说明插入符的用法
#include <iostream>
using namespace std;
class three_d{
public:
int x,y,z;
three_d(int a, int b, int c){ x=a; y=b; z=c; }
};
ostream &operator<<( ostream &stream, three_d obj )
{
stream << obj.x << ",";
stream << obj.y << ",";
stream << obj.z << "/n";
return stream;
}
int main()
{
three_d a(1,2,3), b(4,5,6), c(7,8,9);
cout << a << b << c;
return 0;
}
//--Chapter 18--C++的I/O系统
//--10/15/2006 Sun.
//--Computer Lab
//--Liwei
//说明插入符的用法
#include <iostream>
using namespace std;
class three_d{
public:
int x,y,z;
three_d(int a, int b, int c){ x=a; y=b; z=c; }
};
ostream &operator<<( ostream &stream, three_d obj )
{
stream << obj.x << ",";
stream << obj.y << ",";
stream << obj.z << "/n";
return stream;
}
int main()
{
three_d a(1,2,3), b(4,5,6), c(7,8,9);
cout << a << b << c;
return 0;
}
相关文章推荐
- 《C++捷径教程》读书笔记--Chapter 18--C++的I/O系统--12-15
- 《C++捷径教程》读书笔记--Chapter 18--C++的I/O系统-16
- 《C++捷径教程》读书笔记--Chapter 18--C++的I/O系统--2
- 《C++捷径教程》读书笔记--Chapter 18--C++的I/O系统--3
- 《C++捷径教程》读书笔记--Chapter 18--C++的I/O系统--4-6
- 《C++捷径教程》读书笔记--Chapter 18--C++的I/O系统--7-11
- 《C++捷径教程》读书笔记--Chapter 1--C++的发展历史
- 《C++捷径教程》读书笔记--Chapter 2--C++概述
- 《C++捷径教程》读书笔记--Chapter 6--指针(第一部分)
- 读书笔记(chapter18)
- Professional C++ Chapter 18 Abstract
- C++_Primer_chapter18 3.类成员的指针
- 《C++捷径教程》读书笔记--Chapter 12--类的深入学习(第一部分)
- 《C++捷径教程》读书笔记--Chapter 6--指针(第二部分)
- 《C++捷径教程》读书笔记--Chapter 7--函数,第一部分:基础知识(第一部分)
- C++_Primer_chapter18 7.3 链接指示:extern “C”
- 《C++捷径教程》读书笔记--Chapter 11--类(第一部分)
- 《C++捷径教程》读书笔记--Chapter 7--函数,第一部分:基础知识(第二部分)
- 《C++捷径教程》读书笔记--Chapter 8--函数,第二部分:引用,重载和默认参数
- 《C++捷径教程》读书笔记--Chapter 9--更多的数据类型与运算符(第一部分)