| | |
C++ Extracting data from text files
![]() |
It's exactly C++ battlefield!
Declare class Member as an abstract class (with pure virtual functions), define these virtual functions in FullMember and YoungMember classes, use vector<Member*> in your variant of my PlainDb - that's all. Polymorphism works!..
I suspect that it's a true aim of your (homework?) task.
Declare class Member as an abstract class (with pure virtual functions), define these virtual functions in FullMember and YoungMember classes, use vector<Member*> in your variant of my PlainDb - that's all. Polymorphism works!..
I suspect that it's a true aim of your (homework?) task.
It might not be that simple if you also need to keep track of whether a member is full or young. You would need to output that in some form to your text file, and then as you read the data, create an appropriate object based on whether its a full or young member.
I'm a student. If my statements seem too absolute, feel free to coat them with "In my opinion..." or "I believe...".
you dont need a separate structure for a member_type, use the exisiting structure which coolgamer had suggested and add another field to it.
i think best would be that you try to write some code from whatever you have understood till now and post it, then we can take it from there.
i think best would be that you try to write some code from whatever you have understood till now and post it, then we can take it from there.
"A tree laden with fruits always bends low"
•
•
Join Date: Aug 2008
Posts: 11
Reputation:
Solved Threads: 0
How do you load the data from the txt files into a vector, thats what I can't understand. I have changed my program so that it only uses on text file, but each line of that files starts with either Full Mem or Young Mem depending on the account stored. Also the Young member has 4 pieces of data stored with it wheras the full mem only has three.
I want the program to call up this data so that it can be used in the accounts assciated functions i.e. deposit money, withdraw or calculate the interest etc.
I want the program to call up this data so that it can be used in the accounts assciated functions i.e. deposit money, withdraw or calculate the interest etc.
Last edited by davidleeis14; Aug 5th, 2008 at 7:24 am.
![]() |
Similar Threads
- adware.purityscan (Viruses, Spyware and other Nasties)
- Storing Text file in Database through VB (Visual Basic 4 / 5 / 6)
- spyware, pop-ups and more; amaena?? (Viruses, Spyware and other Nasties)
- adware.purityscan (Viruses, Spyware and other Nasties)
- very weird drive problems (Storage)
- urgent (C)
- Beginner needs assistance with 'error checking' program (C++)
Other Threads in the C++ Forum
- Previous Thread: plotting cpu and mem consumption
- Next Thread: HELP ME MY MISTAKE and HELP THE CORRECT The my homework
Views: 4081 | Replies: 24
| Thread Tools | Search this Thread |
Tag cloud for C++
6 algorithm array arrays assignment beginner binary c++ c++borland c/c++ calculator char class classes code compile compiler constructor conversion convert count data delete display dll dynamic encryption error file files filestream forms fstream function functions game givemetehcodez graph graphics gui homework iamthwee image input int integer lazy link linked-list linker list loop loops math matrix member memory newbie number object objects opengl output parameter pointer pointers problem program programming project random read reading recursion recursive reference return server sort spoonfeeding string strings struct student studio template templates text time tree variable vc++ vector video visual win32 window windows winsock wxwidgets






