t.cpp file
所在版块:求学狮城 发贴时间:2003-02-20 16:56

用户信息
复制本帖HTML代码
高亮: 今天贴 X 昨天贴 X 前天贴 X 
#include <iostream.h>
#include "test.h"

// void increasement(Time &, const int);

main()
{
Time t;
t.sethour(17);
t.setmin(34);
t.setsec(25);

cout << "Result of setting all valid values:\n Hour: "
<< t.gethour()
<< " Minute: " << t.getmin()
<< " Second: " << t.getsec() <<"\n\n";

t.sethour(234);
t.setmin(43);
t.setsec(6373);

cout << "Result of attemping to set invalid hour and"
<< " second\n Hour: " << t.gethour()
<< " Minute: " << t.getmin()
<< " Second: " << t.getsec() <<"\n\n";

t.settime(11,58,0);
// increasement(t, 3);
return 0;
}

//void increasement (Time &tt, const int count)
//{
// cout << "Increasementing minute "<< count
// << " times:\nStart time: ";
// tt.printsta();
//
// for (int i = 1; i<= count ; i++)
// {
// tt.setmin((tt.getmin()+1)%60);
// if (tt.getmin()==0)
// tt.sethour((tt.gethour()+1)%24);
// cout << "\nminute +1: ";
// tt.printsta();
// }
// cout <<endl;
//}
.
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!

 相关帖子 我要回复↙ ↗回到正文
test.h file 和尚庙的主持   (371 bytes , 420reads )
in the test.h file 注册   (70 bytes , 250reads )
test.cpp file 和尚庙的主持   (1049 bytes , 213reads )
t.cpp file 和尚庙的主持   (937 bytes , 222reads )
这三个file都在同一个目录下 和尚庙的主持   (269 bytes , 212reads )
好像C++的class没有modifier吧 simon   (93 bytes , 224reads )
没用,同样的问题还会出现 和尚庙的主持   (0 bytes , 175reads )