converting text to html with c++?

biggels

New member
hi
i am currently struggling with a project of mine.
i have to take any text file and convert whats in the file to html so yo can view it on the web
i have made 1 file so far. source_in(which contains the text.

i have started this but i hit a bump. im having trouble with copying the data to a new file, changing the file to html and putting everything in the html file with p tags etc.
i tried first adding this part:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
but as you can see the "" will not work.

this is my code sofar:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main( int argc, char* argv[] ) {

//open file passed from commandline to get the original text file
ifstream source_in ("C:\ C++");//source txt
char ch=0;

source_in.open("example.txt", ios::out||ios:in); ----> im not sure if you need to create a file already as .html or if you can do it with c++

source_out.open("destination.txt", ios::in);

if (!source_in)
{
cout << "Could not open input file.\n";
return EXIT_FAILURE;
}
source_in.close();
return 0;
}

any help will be appreciated.
 
Back
Top