// 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