Putting Strings into Parallel Arrays

i have an input file that is in the format:
<model><tab><Manufacturer><tab><price>

and looks like this:

Professional AP500	Compaq	2337
Dimension 4100	Dell	1609
Dimension 8100	Dell	1808
Precision Workstation 620	Dell	2848
AMD Athlon Thunderbird	Explorer Micro	717 
Profile 3cx	Gateway	1999
e-Vectra P2024T	Hewlett-Packard	2619
PowerMate VT300	NEC Computers	1160
PCV-RX270DS	Sony	1478
PCV-RX370DS	Sony	1699


This is my code:

using namespace std;
int main() {


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Variables declarations:
	string Model[100];  
	string Manufacturer[100];
	string Price[100];
	int number;
ifstream iFile; // input file stream
ofstream oFile; // output file stream
// The following statements prepare the input and output files for use:	
iFile.open("CompSys.txt"); // open input file

oFile.open("CompLog.txt"); // open output file
oFile << fixed << showpoint;
// Print the header info to output file:
oFile << "Programmer: " << "Jennings Bennett" << endl;
oFile << "CS 1044 Project 4 Fall 2011" << endl;
oFile << endl;
for (number = 0; number < 100; number++)
{
	iFile >> Model[number] >> Manufacturer[number] >> Price[number];
	iFile.ignore(100, '\n');
}
for (number = 0; number < 100; number++)
	{
		oFile << setw(20) << Model[number] << setw(20) << Manufacturer[number] << setw(20) << Price[number];
		oFile << endl;
}


		
// Close the files:
iFile.close();
oFile.close();
}


Right now my output looks like this but i want it to take for example for my first line :Professional AP500 and put that in my Model array and Compaq in my Manufacturer and 2337 in my Price.

   Professional               AP500              Compaq
           Dimension                4100                Dell
           Dimension                8100                Dell
           Precision         Workstation                 620
                 AMD              Athlon         Thunderbird
             Profile                 3cx             Gateway
            e-Vectra              P2024T     Hewlett-Packard
           PowerMate               VT300                 NEC
         PCV-RX270DS                Sony                1478
         PCV-RX370DS                Sony                1699


How do i get the array to take the string all the way until a new tab so that i can get the whole model or the whole manufacture into one string
Topic archived. No new replies allowed.