0
この質問を読んでくれてありがとう。 Idkどのように私のエラーを修正することができます。 なぜ私はそれがエラーであるのか知っていますが、どうすれば修正できるのか分かりません。 見る。これは私のクラスですConsoleDisplayキャストのない整数からポインタを取ります。何を知っているのか分かりません
class ConsoleDisplay {
public:
typedef std::vector<std::vector<std::string> >::iterator screenIt_t;
typedef std::vector<std::string>::iterator panelIt_t;
// Constructor
ConsoleDisplay(const char w[], const char panels, const char height);
void clear();
void refresh();
void write(const std::string& str);
void write(const unsigned char panel, const std::string& str);
void write(const unsigned char panel, const unsigned char row, const
std::string& str);
private:
const std::vector<char> w;
const char h, p;
char lastRow;
std::vector< std::vector<std::string> > screen;
std::vector<std::string> stream;
};
これは私のメインです。
using namespace std;
int main()
{
ConsoleDisplay display(3, 30, 40);
BS_Board board(cin, cout);
display.clear();
board.writeShipGrid(display);
board.writeAttackGrid(display);
display.refresh();
return 0;
}
この問題を解決する方法は本当にわかりません。私はあなたのために多くのおかげで、あなたに願っています。
UPD:私はエラーの場所を追加するのを忘れていました。 ConsoleDisplayの表示(3,30,40):エラー: 'int'から 'const char *'への無効な変換[-fpermissive] –
これは '3 'を渡すことで実現すると期待されることを説明してください。' const char w [ ] 'が期待される。 – StoryTeller
このメソッドは、ゲーム "戦艦"のために設計されています。そして、私はちょうどばかだと思って、ちょうど今私はそれを修正したと思う.. –