由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - [合集] read in file in c++ ,weird ?
相关主题
[转载] Re: [转载] 这样读多个文件对吗?请教cin.get()
How to read binary(data) file generated by Fortran in C/C++ (转载)is there any lib can read .Z file in c++/c program?
help: read mouse position in matlab?a probability interview question.
How to read/load a .tif image? (转载)[合集] how to read c++ books?
how to read CPU time in Fortranread matlab .mat file, by C++???
What's wrong with the following xml reading in C#?Perl question - use perl to read another html files and update new html files
异步通讯代码的简化请教一个static 函数的问题
multi-thread 一问,Interesting read
相关话题的讨论汇总
话题: read话题: file话题: weird话题: data话题: c++
进入Programming版参与讨论
1 (共1页)
b***y
发帖数: 2799
1
☆─────────────────────────────────────☆
ruisher (aa) 于 (Sat Sep 10 00:05:17 2005) 提到:
I want to read in a file in c++, but the weird thing is that it will read in
the last line twice. What's wrong with this?
int main() {
ifstream data;
data.open ("test.txt");
while(data)
{
data>>x>>y>>z;
}
data.close();
return 0;
}
If the file contains
1.2 2.2 3.3
1.3 2.3 4.3
it will reads in
1.2 2.2 3.3
1.3 2.3 4.3
1.3 2.3
1 (共1页)
进入Programming版参与讨论
相关主题
Interesting readhow to read CPU time in Fortran
新人5个包子请教问题,redhat读写文件的内存问题 (转载)What's wrong with the following xml reading in C#?
老板嫌我C++太差!请推荐。异步通讯代码的简化
cgi vs. php for secured loginmulti-thread 一问,
[转载] Re: [转载] 这样读多个文件对吗?请教cin.get()
How to read binary(data) file generated by Fortran in C/C++ (转载)is there any lib can read .Z file in c++/c program?
help: read mouse position in matlab?a probability interview question.
How to read/load a .tif image? (转载)[合集] how to read c++ books?
相关话题的讨论汇总
话题: read话题: file话题: weird话题: data话题: c++