Hey everyone, this is my first post. I have viewed these forums alot in the past for C++ help and it has helped me out alot, however I have reached a problem myself. I have been doing C++ since last September and until then i was a complete newbie at it.
My task is to import a .txt document, store in an array which i must then search through to display different information. The text document contains information like:
1000
John Smith
330.50
1001
Tony Robbins
234.65
I must be able to do a search by reference number (the top one) and surname (which i think you can guess which one that is)
I also need to be able to add to these arrays and save to the .txt file when a new quote is made.
The furthest i have gotten so far is to be able to add the .txt files line by line. I am not sure how to add these into an array. I also got the new quotes to be written to the text documents but it overwrote the exisiting quotes. I realise this is something to do with pointer position (i think) which i can fix, but i would like to do one step at a time and just get the quotes into an array and then be able to do searches.
I have read alot about vectors and wondering if this is the way to go? Not that im too sure how to use them.
At the moment my code just imports the .txt document line by line and then closes. Any help/advice on getting these into array(s) and how i would be able to search them would be amazing help.
Thank you in advance!