Hi I'm studying c++ at university (introduction to it) and i got this assignment, i don't expect the the answer to be given to me straight out, and I've read the sticky's.
i have this file: datafile.txt
contents of it:
/rawprices
P010001 24.99
QX-35 19.99
DVD-player5 58.95
P010002 8.85
P010003 35.00
/items
P010001 2
DVD-player5 1
P010002 20
/invoice
/quit
# /rawprices: this indicates that the data records to follow, if any, will be for the product pricing in the form of
productId price
# /items: this indicates that the data records to follow, if any, will be for the purchased items in the form of
productId quantity
# /invoice: this generates the invoice on the purchased items already read into the program
# /quit: this terminates the program
my code so far before i break my keyboard
im not a c++ genious i understand it at a very basic level, im just struggling to figure out how to put the contents of the txt file in array. if anyone can help me pls do. if this post is against the rules then just delete it sry.Code:#include<iostream> #include<string> #include<fstream> using namespace std; int main() { system("pause"); return 0; }
ty in advance if anyoen can help