0001 Bread Bakery 35.00
0002 Soap Hygiene 20.00
0003 Milk Dairy 40.00
0004 Apples Fruit 30.00
0005 Gelatin Snacks 15.00
0006 Candy Snacks 25.00
0007 Catsup Condiments 40.00
and so im trying to read this grocery.txt file...i'm thinking of using an array...the code ive done would read the first line right? but i want to read as an array if it would be possible..I got an error when trying it..damn, i hate it when my groupmates dont have the effort to help me with our project...so I'm hoping for your support guys!
Note: I'm using turbo c++ 4.5
#include<fstream.h>
#include<cstring.h>
#include<math.h>
#include<conio.h>
void main()
{
ifstream in;
in.open("grocery.txt");
string kw;
string pc;
string c;
string pr;
in>>kw;
in>>pc;
in>>c;
in>>pr;
in.close();
}