程序如下:
#include
#include
using namespace std;
class Time
{
public:
string hour;
string min;
string sec;
};
int main()
{
void set_time(Time&);
void show_time(Time&);
Time t1;
set_time(t1);
show_time(t1);
Time t2;
set_time(t2);
show_time(t2);
return 0;
}
void set_time(Time&t)
{
cout<<"please enter the time:"<
cin>>t.hour>>t.min>>t.sec;
}
void print_time(Time&t)
{
cout<
}
发生的错误:
1>8_2.obj : error LNK2019: 无法解析的外部符号 "void __cdecl show_time(class Time &)" (?show_time@@YAXAAVTime@@@Z),该符号在函数 _main 中被引用
1>C:\Users\方辰1993\Desktop\8_2\Debug\8_2.exe : fatal error LNK1120: 1 个无法解析的外部命令
1>
求解