0

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:

2
Contributors
1
Reply
2
Views
13 Years
Discussion Span
Last Post by kc0arf
0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.