首页 > 编程语言 > 详细

C++ COUT CIN 重定向

时间:2016-01-02 14:14:07      阅读:196      评论:0      收藏:0      [点我收藏+]
 1 #include <iostream>
 2 #include <string>
 3 #include <sstream>
 4 #include <fstream>
 5 
 6 //#define LOCAL
 7 
 8 
 9 using namespace std;
10 
11 int main()
12 {
13     #ifdef LOCAL
14     fstream cout("data.out");
15     #endif // LOCAL
16 
17     string s1 = "50 60";
18     stringstream ss;
19     ss<<s1;
20     ss<<s1;
21     int n = 0;
22     ss >> n;
23     cout<<n<<endl;
24     return 0;
25 }

 

C++ COUT CIN 重定向

原文:http://www.cnblogs.com/yongjiuzhizhen/p/5094431.html

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