address of the first record in the array + (account number - 1000) * sizeof(int).
I am supposed to read this file into 4 separate arrays. And, be able to request a user-entered account number and display the corresponding name and account balance. This is all I come up with so far, but not really sure how to use that formula.
using namespace std;
string filename = "bank.dat";
const int CUSTOMERS=5;
int i=0, acctNum[CUSTOMERS];
string firstName[CUSTOMERS], lastName[CUSTOMERS];
cout<<"\nThe file named "<<filename<<" was not successfully opened"
<<"\nPlease check that the file currently exists."
cout<<"\nThe file has been successfully opened for reading."
cout<<"\nEnter the account number for the customer you are looking for: "<<endl;
this line also gives me this error: error C2679: binary '>>' : no operator found which takes a right-hand operand of type 'int ' (or there is no acceptable conversion)