として認識パラメータI、次の2つの機能を持っています。コンパイル時エラー、参照城と呼ばれるクラスの内部
:私がコンパイルしようとvector<Location> Castle::getMoves(Location*** squares, Location* loc){
int row = loc->getRow();
int col = loc->getCol();
vector<Location> moves;
//problem is here!
getVerticalMoves(squares, &moves, row, col);
return moves;
}
void Castle::getVerticalMoves(Location*** squares, vector<Location*> * moves, int row, int col){
//need to do something here, but can't call the function!
}
、私はこのようになりますエラーが出ます
model/src/Castle.cpp: In member function ‘std::vector<Location> Castle::getMoves(Location***, Location*)’:
model/src/Castle.cpp:26:44: error: no matching function for call to ‘Castle::getVerticalMoves(Location***&, std::vector<Location>*, int&, int&)’
model/inc/Castle.h:38:8: note: candidate is: void Castle::getVerticalMoves(Location***, std::vector<Location*>*, int, int)
make: *** [model/obj/Castle.o] Error 1
このエラーがなぜ表示されるのかわかりません。なぜ私は参照を渡していると言いますか?
無視していることを覚えています。意味がない場合、コンパイラがそれをそのように印刷する理由を知っていますか? –
私は実際の説明を追加しました。 –