|
From: <cg...@wo...> - 2002-12-26 23:04:39
|
Thank you, I tried it over my complete files and works fine.
I use MinGW 2.0.0-2 separately from Dev, too.
In my code there was nothing more than that movement between files, I'll=20
try to rebuild it and see what happens now. I neither tried yet to enter=20
your test inside my project. I'll do it one of these couple days.
Thanks again.
Abhijit Shylanath escribi=F3:
>Greets, Carlos.
>
> =20
>
>> Happy new year tewnty three (hurra for the Empire!)
>> =20
>>
>
>A Happy New Year to everyone.
>
> =20
>
>>I need make an operation over a huge amount of files, basically I
>>fstream.getline(buffer, 255); and then I do whatever. The problem is in
>>all the files one line is treated badly:
>>
>>original:
>>
>>3.429 145.1683002 5.4 0.908401 43.66
>>3.629 174.13 5.28 0.9093 42.86
>>3.859 175.61 5.14 0.909673 41.9
>>4.172 177.08 5.01 0.909293 40.8
>>4.649 178.56 4.91 0.908071 39.57
>> =20
>>
>
> =20
>
>>However remains the question, why can it happen?
>> =20
>>
>
>I tried a simple test program, it works fine with your input (FC returns=
no
>differences). I'm running GCC 3.2. See if this program works with source=
.txt
>being the above values.
>
>----------- Start ------------
>#include <iostream>
>#include <fstream>
>
>int main()
>{
> using std::cout;
> using std::cerr;
> using std::endl;
>
> const int BUF_SIZE =3D 256;
> char buf[BUF_SIZE];
>
> std::ifstream in_file;
> std::ofstream out_file;
>
> in_file.open("source.txt");
> if(!in_file)
> {
> cerr << "Couldn't open source.txt\n";
> return 1;
> }
> out_file.open("dest.txt");
>
> while(!in_file.eof())
> {
> in_file.getline(buf, BUF_SIZE);
> out_file << buf << endl;
> cout << buf << endl;
> }
>
> return 0;
>}
>
>---------- Stop ------------
>
>Tell me what you get. If you get the error (or even if you don't), try
>upgrading to the latest MinGW with GCC 3.2. The URL I used is
>http://osdn.dl.sourceforge.net/sourceforge/mingw/MinGW-2.0.0-2.exe.
>
>It may be out-dated now. Check the MinGW website.
>
>___________________________________________________________
>
>Abhijit Shylanath
>
>E-mail: mu...@gm... || ibr...@bi...
>Web-site: http://mudeth.tripod.com/
>
>
>
>
>
>-------------------------------------------------------
>This sf.net email is sponsored by:ThinkGeek
>Welcome to geek heaven.
>http://thinkgeek.com/sf
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
> =20
>
|