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);
Explanation / Answer
I have compiled you program and does not any error on Turbo C++ 4.5 #include #include #include //using namespace std; void addPlusPlus(ifstream& inStream, ofstream& outStream); int main() { ifstream fin; ofstream fout; coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.