I have an assignment to output contents from a .txt file to html. I'm able to output the information from the .txt to the console but how would I output it into an html page? The txt and html files are in the same folder as my .cpp file.
#include <fstream>
#include <string>
#include <iostream>
using namespace std;
int main() {
ofstream outFS;
ifstream inFS;
string inputFilename;
string outputFilename;
cout<<"Enter file name: " << endl;
cin>>inputFilename;
// Opens file
inFS.open(inputFilename);
// Check to see if file is in directory
if (!inFS.is_open()) {
cout<<"Could not open file " << inputFilename << endl;
return 1;
}
// Reads each line of the file
while (getline(inFS, inputFilename)) {
cout<<inputFilename;
}
inFS.close();
}