Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by zgoran

  1. zgoran

    problem with writing number 10 in binary file

    It works now! Above code (form my firs post) is incomplete. Fstream in definition should have aditional token "ios::binary" in order to work as expected. Thanks xwb for suggestion! Thank you all for help! Goran!
  2. zgoran

    problem with writing number 10 in binary file

    Hello! Well, this is what I ment with " everything in file.bpd gets corrupted". I gave above (my first post) the code that I was using to write numbers in binary file. So everything works fine untill I get to number 10. After number 10 readings gets wrong. Example 1. I wrote 10,20,30...
  3. zgoran

    problem with writing number 10 in binary file

    Well I tried the code under three compilers. Borland C++ 5.5.1 for win32 gives offsets 0,3,5 and wrong reading of number 10 from file. The similar behaviour I noticed for Gnu gcc 3.2. under Cygwin wiht offsets 0,2,5 BUT gcc 2.95.4 (debian prerelease) is workin fine, normal, like you expect it...
  4. zgoran

    problem with writing number 10 in binary file

    Hello everyone! Well, I have a starnge problem. Here is the code, very simple: #include <iostream.h> #include <fstream.h> typedef short int type; int main () { fstream file; file.open(&quot;file.bpd&quot;, ios::in | ios::out); type wr, rd; cout << &quot;writing...&quot; << endl...

Part and Inventory Search

Back
Top