Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fStream difficultys

Status
Not open for further replies.

Keegan

Programmer
May 27, 2001
5
US
okay, heres the program:
#include <Fstream.h>
#include <iostream.h>

void main()
{
char name[15],title[15],head[15];




cout << &quot;Enter the name for the HTML document: &quot;;
cin.get(name, 15);
cin.ignore (80,'\n');

cout << &quot;Enter the title for the HTML page: &quot;;
cin.get(title, 15);
cin.ignore (80,'\n');

cout << &quot;Enter the header for the HTML page: &quot;;
cin.get(head, 15);
cin.ignore (80,'\n');



ifstream htmld;

htmld.open(&quot;html.html&quot;, ios::in);

htmld >> &quot;<html><head><title></title></head><body\n&quot;;
htmld >> title;
htmld >> &quot;><center><h1>\n&quot;;
htmld >> head;
htmld >> &quot;</h1></font></body></html>\n&quot;;

htmld.close();
}


*****************************************************

and heres the error message:
--------------------Configuration: project - Win32 Debug--------------------
Build : warning : failed to (or don't know how to) build 'C:\Program Files\Microsoft Visual Studio\MyProjects\project\project\Debug\project.pch'
Compiling...
project.cpp
c:\program files\microsoft visual studio\myprojects\project\project\project.cpp(51) : fatal error C1010: unexpected end of file while looking for precompiled header directive
Error executing cl.exe.

project.obj - 1 error(s), 1 warning(s)




Do you know whats wrong?????


 
1. This error you always get if the first line in your wizard generated project is not #include&quot;stdafx.h&quot;.
2. What does this line mean?
htmld >> &quot;<html><head><title></title></head><body\n&quot;;
You output from a file intio a constant string? Is a nonsence. You you want to put this string in a file you must do
htmld << &quot;<html><head><title></title></head><body\n&quot;;
A file opened in regime ios::in doesn't support operator <<.
John Fill
1c.bmp


ivfmd@mail.md
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top