Here is my dilemma, I have a snippet of code that I have written to extract data from a file and print it to the screen. It works well.
But now I want to only display lines of the file based on certain
column values in the text. In other words, each line in the file has
29 columns broken down into 5 for an ID, 15 for a name, 3 for a qty, 3for a reorder point, and 3 for the order size.
When the qty columns drop below that of the reorder point I would like to print that to the screen. I am new to C++ and have read the fstream txt's and others I am lost.
Here is my code and file I am pullingfrom. Thanks in advance.
// reading the stock.dat file
char buffer ;
ifstream stock ("stock.dat");
if (! stock.is_open())
cout << "Error opening file";
while (! stock.eof() )
cout << buffer << endl;
} return 0;
- Contents of stock.dat file -