A
AMT2K5
Hello.
I have a file (for a school assignment) with the following format and
delimiter format. Each record in the file has the following format:
123423454567987,29873,James,Harry,St. Louis,416-555-5555;
"accountNumber,balance,lastName,city,phoneNumber;" Each record is
guranteed to be no longer than 350 characters. "balance" is no longer
than 20 characters, "accountNumber" is exactly 15 characters and the
total number of characters in "lastName,firstName,city,phoneNumber;" is
no longer than 315 characters. Copy the fields in this record to the
appropriate data member of the first empty Account in the array
savings, using all the rules for copying (initializing).
Would fgets work in this situation (I have never used fgets)? How would
you guys do it?
Thanks in advance.
I have a file (for a school assignment) with the following format and
delimiter format. Each record in the file has the following format:
123423454567987,29873,James,Harry,St. Louis,416-555-5555;
"accountNumber,balance,lastName,city,phoneNumber;" Each record is
guranteed to be no longer than 350 characters. "balance" is no longer
than 20 characters, "accountNumber" is exactly 15 characters and the
total number of characters in "lastName,firstName,city,phoneNumber;" is
no longer than 315 characters. Copy the fields in this record to the
appropriate data member of the first empty Account in the array
savings, using all the rules for copying (initializing).
Would fgets work in this situation (I have never used fgets)? How would
you guys do it?
Thanks in advance.