本人初学c++,请教一下各位高手如何在vc中编译? // Fig. 6.6: time1.h // Declaration of the Time class. // Member functions are defined in time1.cpp #ifndef TIME1_H #define TIME1_H
// Time abstract data type definition class Time { public: Time(); // constructor void setTime( int, int, int ); // set hour, minute, second void printMilitary(); // print military time format void printStandard(); // print standard time format private: int hour; // 0 - 23 int minute; // 0 - 59 int second; // 0 - 59 };
#endif ----------------------------------------------------- // Fig. 6.6: time1.cpp // Member function definitions for Time class. #include <iostream>
using std::cout;
#include "time1.h" .............略。。。。。。。 --------------------- / Fig. 6.6: fig06_06.cpp // Demonstrate errors resulting from attempts // to access private class members. #include <iostream>
using std::cout;
#include "time1.h"
int main() { Time t; 。。。。略。。。。。。 请问这种应该怎么在vc中编辑运行呀??