Binary and ASCII File I/O Routines Orion Sky Lawlor, olawlor@acm.org, 2005/04/12 Code released to Public Domain Here are examples of binary I/O written with: fread_bin.cpp: C standard library fopen/fread fstream_bin.cpp: C++ standard library ifstream java_bin.java: Java standard library FileInputStream unix_bin.cpp: UNIX open/read system calls win32_bin.cpp: Win32 CreateFile/ReadFile system calls There are also examples of ASCII I/O written with: fread_str.cpp: C standard library scanf, "%s" string. fread_pat.cpp: C standard library scanf, pattern-matching string. fstream_str.cpp: C++ standard library istream and std::string. Finally, there's an example program showing what happens if you keep opening a file again and again, but never close it-- fopen_noclose.cpp will eventually fail. All these programs open the file "test.dat".