Changeset 2428 in Sophya
- Timestamp:
- Sep 12, 2003, 11:06:16 AM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Eval/COS/pbseekios.cc
r2322 r2428 24 24 // # while seekg(... ios::beg) works OK (tstseekbegread()) 25 25 // csh> ./pbseekios 26 // September 2003 27 // The problem with seekg(... ios::end) seems to be solved 28 // with gcc 3.1, 29 // However, on MacOSX 10.2, with gcc 3.1, reading the last byte of 30 // a file causes an error and stream can not be positionned anymore 26 31 // ---------------------------------------------------- 27 32 … … 48 53 float fv; 49 54 char * flnm = "pbseekios.dat"; 50 //ofstream os(flnm, ios::out | ios::binary);55 ofstream os(flnm, ios::out | ios::binary); 51 56 cout << ">>>> tstseqwrite() - Sequential writing to file " << flnm << endl; 52 ofstream os(flnm, ios::out );57 // ofstream os(flnm, ios::out ); 53 58 for(i=0; i<7; i++) { 54 59 iv = 1000+i*10; … … 81 86 cout << "Read@" << i << " : Pos= " << pos << " IV=" << iv 82 87 << " FV= " << fv << " Expect:(" 83 << iv0 << "," << fv0 << ")" << endl; 88 << iv0 << "," << fv0 << ")" 89 << " ->NewPos="<< is.tellg() << endl; 84 90 if (iv != iv0) rc++; 85 91 } … … 115 121 cout << "Read@" << num[i] << " : Pos= " << pos << " IV=" << iv 116 122 << " FV= " << fv << " Expect:(" 117 << iv0 << "," << fv0 << ")" << endl; 123 << iv0 << "," << fv0 << ")" 124 << " ->NewPos="<< is.tellg() << endl; 118 125 if (iv != iv0) rc++; 119 126 } … … 149 156 cout << "Read@" << num[i] << " : Pos= " << pos << " IV=" << iv 150 157 << " FV= " << fv << " Expect:(" 151 << iv0 << "," << fv0 << ")" << endl; 158 << iv0 << "," << fv0 << ")" 159 << " ->NewPos="<< is.tellg() << endl; 152 160 if (iv != iv0) rc++; 153 161 }
Note:
See TracChangeset
for help on using the changeset viewer.