对于类,我制作了一个名为 time 的结构和 h.which 看起来像这样
struct Time{
Time() : hours(0),minutes(0),seconds(0),ticks(0){}
int hours, minutes, seconds, ticks;
};
Time convert (clock_t t, Time &time);
std::string hmst(Time &time);
std::string hmst(clock_t t);
后来我们的老师让我们制作了另一个程序,在这个程序中使用了相同的代码。而不是把它写在我包括在内。第一个问题是这是一个合法的#include(假设路径是正确的)
#include "../p*/*r*/0*/*s/02*/time.h"
第二个问题我需要在我目前正在处理的程序中使用转换函数。我该怎么做呢?我会按如下方式使用范围解析运算符吗
timeobeject=Time::convert(t,time);
或者像这样
timeobject=convert(t,time);