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
Help needed on writing c++program takes a jpeg file name location& output it on HTML
Collapse
X
-
Originally posted by hapaI 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
Code:#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; }
-- Paul
Comment