From: SourceForge.net <no...@so...> - 2005-02-17 20:01:16
|
Bugs item #1124898, was opened at 2005-02-18 06:13 Message generated for change (Comment added) made by dannysmith You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1124898&group_id=2435 Category: gcc Group: Known bugs Status: Open Resolution: None Priority: 5 Submitted By: Dr. Bernhard Friedrichs (bfriedr) Assigned to: Nobody/Anonymous (nobody) Summary: ifstream.read() error Initial Comment: With gcc 3.3.1 and gcc 3.4.2 (both mingw) I get errors if: if (storagebits == 32) { for (i = 0; i < this->samples; i++ ) { ifs.read(static_cast<char *> (static_cast<void *>(&idata32)), sizeof( int)); ddata[i] = (double) (idata32 - adc_dcoffset) * lsbval * adc_factor; cout << i << " " << idata32 << " " << ddata[i] << " " << ifs.tellg() << endl; after reading around 300 binary 32 bit values (casted from char) I see that tellg() doe not increment with 4 bytes and the niumvbers I get are almost constant (ddata[i]). Ps.: The rouitine works fine since 3 years with linux (Suse 7.2, 8.2, 9.2) ---------------------------------------------------------------------- >Comment By: Danny Smith (dannysmith) Date: 2005-02-18 09:01 Message: Logged In: YES user_id=11494 Was ifstream opened in binary mode rather than default text mode? In text mode, CTRLZ (0x1A) means EOF. If this isn't the problem, please provide a self-contained test case so that the problem can be reproduced. Danny ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1124898&group_id=2435 |