ifstream error: "invalid use of member (did you forget the `&' ?)"

I'm trying to write a program which uses classes to complete a range of operations on data from a file. As if the classes aren't causing enough trouble, I can't seem to get the fstream read function to compile. No matter how far I strip my program back I keep generating the same error:

1
2
3
4
5
6
7
8
9
10
#include <iostream>
#include <fstream>

using namespace std;

int main()
{
      ifstream inFile;
      inFile.open = ("operations.dat");      
}


Error:
9: invalid use of member (did you forget the `&' ?)

Can someone please tell me what the problem is? I've got two university-level textbooks which as far as I can tell say this is correct, and in any case C++ doesn't get much simpler.
Line 9 must be inFile.open("operations.dat"); // Note: No '='
Thanks, that's genuinely embarrassing. I put the '=' in when it wasn't working for a different reason, I don't know how I missed it. Maybe something to do with the other 200 lines of code.
Topic archived. No new replies allowed.