278页的Fig. 6.5那个程序,
用
//time1.h
#ifndef TIME1_H
#define TIME1_H
……
#endif
//time1.cpp
#include <iostream.h>
#include "time1.h"
……
//fig 6.5.cpp
#include <iostream.h>
#include "time1.h"
……
这种文件在VC++6.0中怎么改才能运行?改成三个文件吗?
用
//time1.h
#ifndef TIME1_H
#define TIME1_H
……
#endif
//time1.cpp
#include <iostream.h>
#include "time1.h"
……
//fig 6.5.cpp
#include <iostream.h>
#include "time1.h"
……
这种文件在VC++6.0中怎么改才能运行?改成三个文件吗?
新建类time
建类时按change按钮,更改文件名为:time1.h,time1.cpp
新建cpp文件:main.cpp,把main(){}拷进去。或建好类后修改include。