⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subject_21532.htm

📁 一些关于vc的问答
💻 HTM
字号:
<p>
序号:21532 发表者:yingpf 发表日期:2002-11-18 14:40:25
<br>主题:奇怪!?
<br>内容:总是在.CPP文件的最后一行报这个错,不知是何原因:<BR>fatal error C1010: unexpected end of file while looking for precompiled header directive<BR><BR>.H文件如下:<BR>#include &lt;String.h&gt;<BR><BR>#ifndef _STUDENT_H_<BR>#define _STUDENT_H_<BR><BR>class Student<BR>{<BR>private:<BR>&nbsp;&nbsp;&nbsp;&nbsp;CString m_strNumber;<BR>&nbsp;&nbsp;&nbsp;&nbsp;CString m_strName;<BR>&nbsp;&nbsp;&nbsp;&nbsp;bool&nbsp;&nbsp;&nbsp;&nbsp;m_bSex;<BR>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;&nbsp;&nbsp;&nbsp; m_iAge;<BR>private:<BR>&nbsp;&nbsp;&nbsp;&nbsp;Student(void);<BR>&nbsp;&nbsp;&nbsp;&nbsp;Student(CString &amp;strName, CString &amp;strNumber);<BR>&nbsp;&nbsp;&nbsp;&nbsp;~Student(void);<BR>public:<BR>&nbsp;&nbsp;&nbsp;&nbsp;int GetAge(void);<BR>};<BR>#endif<BR><BR>CPP文件如下:<BR><BR>#include "student.h"<BR><BR>Student::Student()<BR>{<BR>}<BR><BR>Student::Student(CString &amp;strName, CString &amp;strNumber)<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_strName = strName;<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_strNumber = strNumber;<BR>}<BR><BR>int Student::GetAge()<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;return m_iAge;<BR>}<BR><BR>Student::~Student()<BR>{<BR><BR>}<BR>
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:CDMA2000 回复日期:2002-11-18 14:41:34
<br>内容:在最前面加上#include "stdafx.h"
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:yingpf 回复日期:2002-11-18 14:46:36
<br>内容:为何每一个.CPP文件,都要#include "stdafx.h"呢??
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:CDMA2000 回复日期:2002-11-18 14:53:34
<br>内容:stdafx.h包含了标准的系统包含文件和工程中哪些经常使用但很少改动的包含文件,将这些文件预编译,产生预编译头文件,可以节省每次编译的时间!
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -