标题:一个很简单的问题,打开文件夹的问题
取消只看楼主
orleans
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2010-4-5
结帖率:100%
 问题点数:0 回复次数:0 
一个很简单的问题,打开文件夹的问题
文件夹名:infile.you    文件夹内容:
1
2
3
4
程序代码:
#include <fstream>
#include<iostream>
int main( )
{
    using namespace std;
    ifstream in_stream;
    ofstream out_stream;
    in_stream.open("infile.you");
    out_stream.open("outfile.you");
    int first, second, third;
    in_stream >> first >> second >> third;
    out_stream << "The sum of the first 3\n"
               << "numbers in infile.you\n"
               << "is " << (first + second + third)
               << endl;
    in_stream.close( );
    out_stream.close( );
system("pause");
    return 0;
}
然后译出来的结果应该是6,为什么我译出来的是一堆数字????

谢谢
搜索更多相关主题的帖子: 文件 
2010-04-07 10:26



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-301943-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.133818 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved