help me wth file

Reply

Join Date: Jul 2004
Posts: 2
Reputation: nita is an unknown quantity at this point 
Solved Threads: 0
nita nita is offline Offline
Newbie Poster

help me wth file

 
0
  #1
Jul 20th, 2004
hi
I have problem with file. The problem is I have to compare two file 1)master file and 2)transaction file. both have accno, amount,id and code(d-deposit,w-withdraw). the accno is in char[10] ,amount double, id integer and code character[1].

my problem is how to compare accno from master file with accno from transaction file,because both acc no is character and if acc no(master file) equal acc no(transaction file) i have to copy the accno(master file) and the rest(amount,id) to new master file.all file is in sequential file.

can anyone help me
asap
tq :rolleyes:
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 1,620
Reputation: kc0arf is a jewel in the rough kc0arf is a jewel in the rough kc0arf is a jewel in the rough 
Solved Threads: 51
Team Colleague
kc0arf kc0arf is offline Offline
Posting Virtuoso

Re: help me wth file .asap

 
0
  #2
Jul 20th, 2004
Hello,

This should be pretty straightforward.

First, you need to create two data structures in memory. They will be the same structures, but one will be the master file data, and the other will be the transaction file.

Couple things for you to think about:
* Array or linked list?
* Look up the string compare function to see how to compare account numbers
* How will you handle bad data in the transaction file?
* When the program is done, write out the memory to a flat file.

Go ahead and code this out. If you need more help, please show us some psuedo code, and let us help. We cannot go too much further in assistance, as it would violate DaniWeb homework policy.

Christian
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC