Hi, I have the following code but I am getting an error with the fin and fouts.
ID: 3632294 • Letter: H
Question
Hi,I have the following code but I am getting an error with the fin and fouts. Do you know why?
#include <iostream>
#include <fstream>
#include <cstdlib>
using namespace std;
void addPlusPlus(ifstream& inStream, ofstream& outStream);
int main()
{
ifstream fin;
ofstream fout;
cout<<"Begin editing files. ";
fin.open("convert.cpp"); //input file (must in the same folder)
if (fin.fail())
{
cout<<"Input file opening failed. ";
exit(1);
}
fout.open("convert.html"); //output file (in the same folder)
if (fout.fail())
{
cout<<"Output file opening failed. ";
exit(1);
}
fout << "<PRE>"<< endl; //<PRE> is the tag for HTML file that will convert all the spacing according to the input file
addPlusPlus(fin, fout);