I do not understand why this is not working. For some reason, I get an error:
error C2678: binary '>>' : no operator found which takes a left-hand operand of type 'std::istream' (or there is no acceptable conversion)
I do this in Visual Studio2010 C ++ Express if that helps. Not sure why he passed me this error, I made other programs using cin...
My code is:
#include <iostream>
#include <iomanip>
#include <fstream>
using namespace std;
int main(int argc, char* argv){
string file;
if (argc > 1)
{
file = argv[1];
}
else
{
cout << "Please Enter Your Filename: ";
cin >> file;
}
}
source
share