以下代码块生成了错误
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’
答案 0 :(得分:1)
编译器不知道rating
。 #include it ...