Pointers?

I continue to get some crazy errors when trying to run this program. I'm trying to have the user input what each person's balance is. If I assign a value to each variable, the program runs fine. I don't understand whats going wrong. I understand it has something to do with the whole input, but I don't know what I'm doing wrong. Any ideas?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
int main()
{
   float accSam = 0;
   float accSue = 0;

   float *pAcc;

   cout << "What is Sam's balance? ";
   cin >> accSam >> endl;
   cout << "What is Sue's balance? ";
   cin >> accSue >> endl;
   if(accSam > accSue)
      pAcc = &accSam;
   else
      pAcc = &accSue;

   cout << *pAcc << endl;
   return 0;
}
lines 9 and 11

cin >> .... >> endl;
What is the purpose with endl when you're trying to get input from the user?
Wow I didn't even realize I put that in there. And would you look at that, no more errors. Thank you for pointing that out.
Topic archived. No new replies allowed.