c++ compiling “error: expected constructor, destructor, or type conversion before '=' token ”

后端 未结 4 435
暖寄归人
暖寄归人 2021-01-19 03:55

Very simple codes located in the same file \'foo.h\':

class Xface
{
  public:
    uint32_t m_tick;
    Xface(uint32_t tk)
    {
      m_tick=tk;
    }
}

std         


        
4条回答
  •  清酒与你
    2021-01-19 04:55

    class Xface
    {
      public:
        uint32_t m_tick;
        Xface(uint32_t tk)
        {
          m_tick=tk;
        }
    }    // need a semicolon here
    

    You are missing a semicolon at the end of the class definition.

提交回复
热议问题