类的问题
我用的是VC++6.0版本的,#include <iostream.h>
class clock
{
public:
void settime(int newh=0,int newm=0,int news=0);
void showtime();
private:
int hour,minute,second;
};
void clock::settime(int newh,int newm,int news)
{
hour=newh;
minute=newm;
second=news;
}
inline void clock::showtime()
{
cout <<hour<<":"<<minute<<":"<<second<<endl;
}
void main()
{
clock myclock;
cout <<"第一次时间为:";
myclock.settime();
myclock.showtime();
cout <<"第二次时间为:";
myclock.settime(8,30,30);
myclock.showtime();
}
我是照书抄的他提示
--------------------Configuration: clock - Win32 Debug--------------------
Compiling...
clock.cpp
e:\program files\microsoft visual studio\myprojects\clock\clock.cpp(30) : fatal error C1010: unexpected end of file while looking for precompiled header directive
Error executing cl.exe.
clock.obj - 1 error(s), 0 warning(s)
---------------------------------------------------------------------------------------------------------------
我哪里出错了,谢谢各位了!
[ 本帖最后由 bccnpop 于 2009-11-30 11:59 编辑 ]