您的位置:首页 > 编程语言 > C语言/C++

《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; 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息