954,505 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Please Check The Errors'..Dont know what else to do

#include
#include
#include
#include

//for logfile
struct log
{
long number;
char date[9];
char time[9];
char gate[2];
};

//for customers
struct customer
{
long number;
char initial[2];
char lname[20];
char snumber[7];
char sname[17];
char stype[17];
char suburb[17];
char state[4];
char postcode[5];
};

//constants for array sizes
const int MAXLOGS=50;
const int MAXCUST=20;


// function protoytpes
int searchProcessed(long[],long,int);//searches already processed records
int find (customer[],long,int); //searches customer array
void showHeadings(); //show headings
void drawline(); //draws line

int main ()
{
//declare array to hold logs
log logArray[MAXLOGS];

//declare infile stream and link to log.txt
ifstream in;
in.open("log.txt");

int numOfLogs = 0; // number of logs

//load-up array with logs
while(!in.eof())
{
in >> logArray[numOfLogs].number;
in >> logArray[numOfLogs].date;
in >> logArray[numOfLogs].time;
in >>logArray[numOfLogs].gate;
in >> ws;
numOfLogs++;
}
in.close();

//declare array of type customer
customer customerArray[MAXCUST];
//open the file
in.open("customer.txt");


int numberOfCustomers = 0; //number of customers

//load-up array with customers
while(!in.eof())
{
in >> customerArray[numberOfCustomers].number;
in >> customerArray[numberOfCustomers].initial;
in >> customerArray[numberOfCustomers].lname;
in >> customerArray[numberOfCustomers].snumber;
in >> customerArray[numberOfCustomers].sname;
in >> customerArray[numberOfCustomers].stype;
in >> customerArray[numberOfCustomers].suburb;
in >> customerArray[numberOfCustomers].state;
in >> customerArray[numberOfCustomers].postcode;
in >> ws;
numberOfCustomers++;

}
in.close();

//declare array of type long, to hold custNumbers of
//previously processed records
long processed[MAXLOGS];
//initialize to zero
for (int i=0;i=0)
{
drawline(); //draw a line

cout << "\nEWAY BILL E-way Motorway\n"
<< " " << customerArray[position].number;
cout << "\n \n"<

gerizzel
Newbie Poster
4 posts since May 2004
Reputation Points: 11
Solved Threads: 0
 

and what's wrong? (ie. does it not compile, or does it not work as you think it should?)

asqueella
Newbie Poster
9 posts since Apr 2004
Reputation Points: 10
Solved Threads: 0
 

it doesnt compile .. but there an error

gerizzel
Newbie Poster
4 posts since May 2004
Reputation Points: 11
Solved Threads: 0
 

Three Great Virtues Of A Programmer
What's the error you see? It's much easier to check if you provide the compiler/linker messages. Also please put your program into [ code] tag, so that the formatting is preserved.

asqueella
Newbie Poster
9 posts since Apr 2004
Reputation Points: 10
Solved Threads: 0
 

Also add what your program is supposed to do(a general idea) and put the compiler out put in [ c o d e ]

FireNet
Posting Whiz in Training
258 posts since May 2004
Reputation Points: 108
Solved Threads: 7
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You