I want to write a program that take a name of a person and also a name of a jpeg file with known destination and create an output on an HTML format but it should also display the picture help me out it is easy to take in name using CIN and Output file can be created usuing ofstream but the problem is how can i output a picture. can some body help me out
It's not entirely clear what you want, but perhaps this will help get you started.
-
#include <cstdio>
-
#include <iostream>
-
#include <fstream>
-
#include <cstdlib>
-
-
using namespace std;
-
-
int main( int argc, char* argv[] )
-
{
-
char JpegFileName [1025];
-
cout << "Input jpeg filename: ";
-
cin >> JpegFileName;
-
-
ofstream html_file( "image.html", ofstream::out );
-
-
html_file << "<html>" << endl
-
<< "<head>" << endl
-
<< JpegFileName << endl
-
<< "</head>" << \endl
-
<< "<body>" << endl << "<p>" << endl
-
<< "<img src=\">" << JpegFileName << "\">" << endl
-
<< "</p>" << endl
-
<< "</body>" << endl
-
<< "</html>" << endl;
-
-
html_file.close();
-
-
return 0;
-
}
-
Now, that generated file is not entirely
w3c-standards compliant, but it's easy enough to add what's required to the header of the file. (character encoding and, doctype, etc.)
-- Paul