You have a few errors.
This line is wrong infile>>l>>f>>;
it should be infile>>l>>f;
You probably also want to put it inside the loop condition instead like this while(infile>>l>>f)
Read here for why http://www.parashift.com/c++-faq-lite/input-output.html#faq-15.5
If total is not a bank object you can't add it to the vector.
Is this a mistake? total=toatl++;
vector has the size() function that gives the number of elements in the vector so no need to keep a count outside.
I think you are putting the cart ahead of the horse a bit. Instead of putting a default temp object in the vector and then using your assign() function, try doing it the other way around:
1 2 3 4 5 6 7
while(infile.good())
{
infile >> l >> f;
bank temp;
temp.assign(l,f);
obj.push_back(temp);
}
how would i do the assign member. I trying doing obj.assign(l,f); but it gave me an error. Also how would i add an element to the vector. I tried doing obj.push_back(temp); but didn't work.