错误:之前的预期类型说明符

时间:2013-04-15 08:50:28

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

以下代码块生成了错误

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’

1 个答案:

答案 0 :(得分:1)

编译器不知道rating。 #include it ...