I try to keep up but I must have written down something wrong.
I get error C2661: 'std::basic_ifstream<_Elem,_Traits>:pen' : no overloaded function takes 0 arguments
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
What does this mean?
Code:
#include <iostream>
#include <fstream>
using namespace std;
#include <conio.h>
#include <string>
int main()
{
//Step01: Declare Memory Location
ifstream InFile;
ofstream OutFile;
string MyWord;
//Step02: Initialize Memory Location
InFile.open("C:/Temp/TestData1.txt");
OutFile.open("C:/Temp/TestData1.txt");
//Step03: Do the Work
if (!InFile.open()) //Boolean value (True/False)
{
cout << "File does not exist" << endl;
getch();
exit (0);
}
InFile >> MyWord;
cout << MyWord << endl;
OutFile << MyWord;
InFile >> MyWord;
cout << MyWord << endl;
OutFile << MyWord;
//Step04: Wrap up and Exit
cout << endl;
getch();
return 0;
}
Any hints?