some progress made. i may have just needed the personal note --have been working on this stuff all day, the end of the term is coming on fast and we just took test 1 of 3 yesterday. here she is:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
bool loadArrays(const char fileName[], long idArray[],
int storeArray[], int qtyArray[], int & count, int maxCells);
void printArrays(ostream & where, const long idArray[],
const int storeArray[], const int qtArray[], int count);
bool extractData(const char newFileName[],int requestId, int baseQty,
const long idArray[], const int storeArray[],
const int qtArray[], int count, int & newcount);
const int ORDER_VALUE = 500;
int main() {
/*
fileName - the Windows name of the file created in step 1
newFileName - the Windows file name of the file of extracted records
requestId - the product id number used to extract data
ORDER_VALUE - the quantity value used to extract data, make this
a global constant with a value of 500
idArray - the array of id numbers
storeArray - the array of store numbers
qtyArray - the array of quantities
count - the actual number of cells filled in the arrays
newcount - the number of extracted records written to
*/
char fileName[] = "products.txt";
char newFileName[] = "list.txt";
int requestID;
int idArray[ORDER_VALUE], storeArray[ORDER_VALUE], qtyArray[ORDER_VALUE];
int count = 0, newCount = 0;
if( loadArrays(fileName, idArray, storeArray, qtyArray, count, 20) )
printArrays(cout, idArray, storeArray, qtyArray, count);
return 0;
} // end main
bool loadArrays(const char fileName[],long idArray[],
int storeArray[], int qtyArray[], int & count, int maxCells) {
ifstream in;
in.open(fileName);
if(!in) return false;
for(int i = 0; !in.eof(); i++) {
in >> idArray[i];
in >> storeArray[i];
in >> qtyArray[i];
count = i;
}
in.close();
return true;
}
void printArrays(ostream & where, const long idArray[],
const int storeArray[], const int qtyArray[], int count) {
for(int i = 0; i <= count; i++)
where << idArray[i] << " " << storeArray[i] << " " << qtyArray[i] << endl;
}
bool extractData(const char newFileName[],int requestId, int baseQty,
const long idArray[], const int storeArray[],
const int qtArray[], int count, int & newcount) {
}
I'm using gnu compiler if this matters.. what am i doing wrong? thx