sorry to ask another question, but i need to use a struct, and am declaring it like this...
Code:
struct Transaction // Declaration of Transaction Structure
{
int ordernumber;
char date[10];
int orderedproductid;
float priceperproduct;
int numberordered;
char productlineid[10];
int customerid;
};
and.... this is where i use it... first is a counter to find how many
lines are in the file, so thats how i know how large to declare my records.
while( (ch = transactionin.peek()) != EOF) // this counts how many lines are
{ // in the transaction.h data file
transactionin.getline(line,100,NEWLINE);
LINECOUNTER++;
}
const int MAXRECS = LINECOUNTER; //used to declare amount of space in the structure
Transaction records[MAXRECS] ; //declaring the structure with MAXRECS number
thats only part of my code, the counter works fine, but it says my maxrecs needs to be a constant, and i can not get this to work since i need to set maxrecs equal to the linecounter from above.
thanks
Jon