为了账号安全,请及时绑定邮箱和手机立即绑定

IntelliSense: no instance of constructor "Watch::Watch" matches the argument list argument types are: (Time)

class Watch
{
public:
 Watch(Time t) :m_tTime(t.m_iHour,t.m_iMinute,t.m_iSecond)
 {

 }
 void display()
 {
  cout << m_tTime.m_iHour << endl;
  cout << m_tTime.m_iMinute << endl;
  cout << m_tTime.m_iSecond << endl;
 }
public:
 Time m_tTime;
};

类Watch是这样实现的,但是运行后错误列表里针对mian中Watch w(t);有个:IntelliSense: no instance of constructor "Watch::Watch" matches the argument list argument types are: (Time)。不知道怎么修改,神奇的是不影响运行出结果。

正在回答

1 回答

我把你的代码跑了一下发现没问题啊,也没有编译错误,你是不是别的部分有问题?贴出来看看

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
C++远征之模板篇
  • 参与学习       91174    人
  • 解答问题       318    个

本C++教程力求即学即会,所有知识以实践方式讲解到操作层面

进入课程

IntelliSense: no instance of constructor "Watch::Watch" matches the argument list argument types are: (Time)

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信