GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 10-Jul-2006, 09:16
Tomb332's Avatar
Tomb332 Tomb332 is offline
Junior Member
 
Join Date: Jul 2006
Location: Everywhere and yet nowhere at all
Posts: 47
Tomb332 is on a distinguished road
Unhappy

File write / read problem


Three questions
1. how do you put two flags on a fout() order?

2. How woult you write 4 arrays of objects to a binary file (could this file be a .dat file)?

3. How would you read the arrays back again

The reason for Q's 2 and 3 is to make a database program but with the data stored in a file (the program will have a limited writing facility) insted of 400 ish lines of code creating the objects every time the program was run.
  #2  
Old 10-Jul-2006, 10:55
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,243
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all

Re: File write / read problem


Quote:
Originally Posted by Tomb332
Three questions
1. how do you put two flags on a fout() order?
Not a clue what you mean. What's an fout() order?

Quote:
Originally Posted by Tomb332
2. How woult you write 4 arrays of objects to a binary file (could this file be a .dat file)?
Use fwrite() on each entire array.

Quote:
Originally Posted by Tomb332
3. How would you read the arrays back again
Use fread() in the same order.
__________________

Age is unimportant -- except in cheese
  #3  
Old 12-Jul-2006, 01:15
Tomb332's Avatar
Tomb332 Tomb332 is offline
Junior Member
 
Join Date: Jul 2006
Location: Everywhere and yet nowhere at all
Posts: 47
Tomb332 is on a distinguished road

Re: File write / read problem


Quote:
Not a clue what you mean. What's an fout() order?


fout() the order used to open a file for writing included in fstream.h in standard librarys
 
 

Recent GIDBlogMeeting the local Iraqis by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Airport Log program using 3D linked List : problem reading from file batrsau C Programming Language 11 29-Feb-2008 07:44
CGI write to file problem DReaMer66 Apache Web Server Forum 1 16-Mar-2005 19:23
How to detect end of file with read() function call? nkhambal C Programming Language 6 12-Oct-2004 01:08
CD burner wont burn!! robertli55 Computer Hardware Forum 1 18-Jun-2004 10:53
Yet another CD burner problem: Lite-On LSC-24082K Erwin Computer Hardware Forum 1 22-May-2004 11:28

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 23:24.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.