I need some sample C++ code to understand how to read from a text file into a vector to use in a stl list container...can anybody help
· Read the scholarship information from the database (flat file).
· Add new records to the database.
· Delete existing records from the data base
· List all the records in the data base.
· Print report of scholarship amounts (with totals).
Date First Name Last Name Scholarship Amount
10/15/95 Melissa Randall Music $ 1,000.00
10/16/95 Robert Brown Science $ 500.00
10/17/95 Mary Crow Business $ 100.00
10/18/95 Terrisa Mann Athletics $ 200.00
11/1/95 William Gentry Fine Arts $ 700.00
11/3/95 Betty Bolton Business $ 3,000.00
11/7/95 Jesse Ramos Athletics $ 750.00
11/10/95 Wanda Granhame Music $ 100.00
11/22/95 Lynn Wong Science $ 2,000.00
11/28/95 Susan Lopez Science $ 5,000.00
------------------------------------------------------------
Total Donations: $11,350.00
· (optional)Print sorted records (sort by any field in data base).
· End program and update data base files.
Build a linked list from the data in the file:
· A list of all the fields in the database.
o Date of donation
o Donor first name
o Donor last name
o Scholarship name
o Amount of donation
Reading fields from a text file into a vector into a STL list ContaineStL List Containers
Page 1 of 1
3 Replies - 2977 Views - Last Post: 04 May 2010 - 11:29 AM
#1
Reading fields from a text file into a vector into a STL list Containe
Posted 04 May 2010 - 11:05 AM
Replies To: Reading fields from a text file into a vector into a STL list Containe
#2
Re: Reading fields from a text file into a vector into a STL list Containe
Posted 04 May 2010 - 11:17 AM
Sorry but we can not give you the entire code to solve your problem. We are here to assist in solving problems with code you have written, with any error messages you are getting or what isn't working the way that you expect it to, we would be more than happy to help you with those problems. If there is a topic that you don't understand we would be more than happy to help you with that as well. Make sure to post any code with in code tags like below.
Be sure to visit our tutorial and snippet areas or read the FAQS at the top of the forums. Also, take a moment to read the rules about posting topics.
Thank you for helping us to help you solve your problem.
Be sure to visit our tutorial and snippet areas or read the FAQS at the top of the forums. Also, take a moment to read the rules about posting topics.
Thank you for helping us to help you solve your problem.
#3
Re: Reading fields from a text file into a vector into a STL list Containe
Posted 04 May 2010 - 11:23 AM
You probably want to use struct which is often used for database records.
Structures inside STL List
list::push_back
Structures inside STL List
list::push_back
#4
Re: Reading fields from a text file into a vector into a STL list Containe
Posted 04 May 2010 - 11:29 AM
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote





|