c++ without fear binary write sample program problem

Hey all,

"Someone with the c++ without fear book" help.

I am trying to run the binary file write and read sample programs that are included in the book on my netbeans 6.5 IDE (the one with the book wont run with vista). Every example has worked up until now. The program compiles and links ands runs fine. When I am prompted to enter a file to write to I enter a name like file1 in a directory and then it says that the file cannot be opened.At this point I have copied the code from the provided cd and it still does this. I am using windows vista. Does binary files act differently on vista that this book does not explain?
C++ is meant to be portable, so a call to a standard function should give the same result regardless of the system.
There are many reasons that coud be causing this error: the file existing and being attempted to open without overwriting (I'm not sure ATM if that's possible in C++), the file existing as a directory, the file being read-only, the file system being full.
And, of course, poorly written code.
Last edited on
It is the code sample that is in the book.
Topic archived. No new replies allowed.