I have looked at a couple of links such as this and this.
Unfortunately I'm just to new of a programmer to figure it out. I would like to have the following as the line while( getline(getline(fin, line) )
because I'm trying to read in the entire line of text from a file. Then I'm trying to figure out if there are any similar words or numbers in that file. I'm writing this in Microsoft visual studio 2012.
#include <iostream>
#include <fstream>
#include <sstream>
#include <cctype>
#include <string>
using namespace std;
// main application entry point
int main(int argc, char * argv[])
{
string filename;
ifstream inFile;
// request the file name from the user
cout << "Please enter a filename: ";
// stores the users response in the string called filename
cin >> (std::cin, filename);
// opens the file
inFile.open(filename.c_str());
// if the file doesn't open
if (!inFile)
{
cout << "Unable to open file: " << filename << endl;
return -1;
} // end of if( !inFile )
// while( getline(getline(fin, line) ) gives me the same error
while (getline())
{}
// close the file
inFile.close();
} // end of int main( int argc, char* argv[])