首页 > 其他 > 详细

cout

时间:2017-11-16 21:34:53      阅读:242      评论:0      收藏:0      [点我收藏+]
 1 #include <stdio.h>
 2 
 3 class MyOut
 4 {
 5 public:
 6     const MyOut& operator<<(int value) const
 7     {
 8         printf("%d", value);
 9         return *this;
10     }
11 
12     const MyOut& operator<<(char *value) const
13     {
14         printf("%s", value);
15         return *this;
16     }
17 };
18 
19 MyOut out;
20 
21 int main()
22 {
23     char str[] = "HelloWorld\n";
24     int a = 10;
25     out << str << a;
26     return 0;
27 }

 

cout

原文:http://www.cnblogs.com/nosit/p/7846285.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!