c++简单问题,错误 1 error LNK2019: 无法解析的外部符号 "public: void __thiscall Clock::set
#include<iostream>usingnamespacestd;classClock{public:Clock(intnewH,intnewM,intnewS);...
#include<iostream>
using namespace std;
class Clock{
public:
Clock(int newH, int newM, int newS);
void setTime(int newH, int newM, int newS);
void showTime();
private:
int hour, minute, second;
};
Clock::Clock(int newH, int newM, int newS){
hour = newH;
minute = newM;
second = newS;
}
int main()
{
Clock c(0,0,0);
c.showTime();
c.setTime(8,30,30);
system("pause");
}
源代码是这个 展开
using namespace std;
class Clock{
public:
Clock(int newH, int newM, int newS);
void setTime(int newH, int newM, int newS);
void showTime();
private:
int hour, minute, second;
};
Clock::Clock(int newH, int newM, int newS){
hour = newH;
minute = newM;
second = newS;
}
int main()
{
Clock c(0,0,0);
c.showTime();
c.setTime(8,30,30);
system("pause");
}
源代码是这个 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询