How do you search & sort an array?
I have two files and I would like to seach them and sort them in any order. My two data files are cust.dat and order.dat.
Code:
Cust.dat contains:
CustomerId
CustomerFirstName
CustomerMiddleName
CustomerLastName
CustomerAddress
CityStateZip
CustomerPhoneNo
CustomerEmailAddress
order.dat contains:
orderId
width
length
CarpetCharge
discount
int NotFound = 0;
While((k < NUM_OF_CUSTOMERS) && (NotFound ==1))
{
if ( searchKey ==custRec[key]customerId)
{
NotFound = 0;
}
if ( searchKey ==orderRec[key]orderId)
{
NotFound = 0;
}
K++;
}
How would I go about sorting it into the fields say CustomerFirstName or by TotalBill?
Thanks for any help you can provide.
Re: based on more than one criteria?
Yes, I belive you understand what I am trying to accomplish.
So, I think that I would need a search to pull it off. I'm just not sure how to do it.