![]() |
|
#21
|
||||
|
||||
|
Standard I/O - Example #3 (Windows)
This example creates a binary file of structures. The application is a windows application. The screen will have five input boxes: name, social security number, age, and gpa. There is a save button on the screen. When the user fills in all input boxes and clicks the save button, the application places the data in a structure and writes the structure to a binary file. If the file has other structures in it, the new structure is appended at the end of the file. CPP / C++ / C Code:
Once the data has been stored in the structure, we open the output file in append mode in binary format. If the opening of the file succeeded, we write (append) the structure to the file. We then close the file. If there is a problem either opening the file or writing to the file, we have an error window displayed. Always remember that failing to test all file I/O will result in poor code, poor execution, and unhappy customers. If you liked this tutorial, please give me a bump on my reputation. If not, just leave it alone ;-) To discuss this tutorial: please follow the discussion here http://www.gidforums.com/t-2632.html. Last edited by JdS : 09-May-2004 at 09:26.
Reason: Split discussion into it's own thread
|
||||
Recent GIDBlog
Problems with the Navy (Chiefs) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Re: Formatting C / C++ code | WaltP | C Programming Language | 1 | 07-Jan-2008 00:59 |
| Re: Naming Conventions | WaltP | C Programming Language | 8 | 06-Jun-2004 23:22 |
| New wi-fi standard approved - here comes 24-54Mbps | jrobbio | Open Discussion Forum | 1 | 17-Jul-2003 01:29 |
| [Tutorial] XSL Basics Pt. I | pcxgamer | Web Design Forum | 15 | 22-Apr-2003 07:59 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The