Hello ladies and gents,
Have a few questions about the following example that is given:
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
char ch;
int n=0;
ifstream ff("aa");
if (!ff)
{
cout << "Can't open file aa for input.\n";
return 1;
}
ofstream gg("bb");
if (!gg)
{
cout << "Can't open file bb for output.\n";
return 1;
}
// Copying starts here:
while (ff.get(ch))
{
gg.put(ch);
n++;
}
cout << n << " characters copied.\n";
return 0;
}
When talking about "can't open file aa for input". Could this be for example a Word document? Is that what 'a file' could point to???
Also,
ifstream ff("aa");
Is it the intention to put an actual link towards an existing file like for example C:/MyPrograms/Microsoft Visual/ ... within this part (" ") If this type of code would be used in a real example :?: