【问题标题】:Error: expected type-specifier before [closed]错误:[关闭]之前的预期类型说明符
【发布时间】:2013-04-15 08:50:28
【问题描述】:

以下代码块产生了错误

rating* TrustManager::initNewRating(double alpha, double beta, double fading)
{
   rating* rating = new rating(1.0, 1.0);
   rating->updateRating(alpha, beta, fading, 1);
   return rating;
}

错误是

error: expected type-specifier before ‘rating’
error: cannot convert ‘int*’ to ‘rating*’ in initialization
error: expected ‘,’ or ‘;’ before ‘rating’

【问题讨论】:

  • 继续调试您的问题。
  • 不确定这是否能解决您的问题,但您不应该以相同的方式调用类和变量 (rating* rating)

标签: c++ c++11 c++builder


【解决方案1】:

编译器不知道rating。 #包括它...

【讨论】:

    猜你喜欢
    • 2012-02-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多