Once you've done that, the stream infile can be used for input using similar syntax as would be used with the standard input cin. e.g.
1 2
int n;
infile >> n; // read an integer from the file
You need to do two additional things.
a) test whether or not the file access was successful.
b) use some sort of loop to process all of the items in the file.
Typically you'd use a while loop, to do both of those things in a fairly straightforward way. See for example the section on text files in the tutorial http://www.cplusplus.com/doc/tutorial/files/