私はstd :: arraysを含む両端キューを持っています。配列を含む構造体
構造体を含むdequeに変換したいです。 私が作った構造体は、このようなものです:
struct New_Array {
array<array<int,4>,4> tablee;
int h;
} Jim;
そして私が訪問した名前が付けられていデック:
deque<New_Array> visited;
私はそのような機能がPrintBoardという名前の配列を印刷しています。私はPrintBoard(visited.front());
を書くとき
void PrintBoard(New_Array tt) {
using namespace std;
for (int iRow = 0; iRow < 4; ++iRow) {
for (int iCol = 0; iCol < 4; ++iCol) {
cout << tt.tablee[iRow][iCol];
cout << " ";//This space helps so the numbers can be visable
//to the user
}
cout << endl;
}
}
それが問題である何私にerror C2664: 'PrintBoard cannot convert parameter 1 from 'New_Array' to std:tr1::array<_Ty,Size>'.
を与えますか?私はテーブルを一次元として使ったことはありません。
EDIT:
#include <deque>
#include <vector>
#include <array>
using namespace std;
struct New_Array {
array<array<int,4>,4> tablee;
int h;
}str_test,Jim;
deque<New_Array> visited;
void dfs()
{
PrintBoard(visited.front());//****the error is in this line****
}
void PrintBoard(New_Array tt) {
using namespace std;
for (int iRow = 0; iRow < 4; ++iRow) {
for (int iCol = 0; iCol < 4; ++iCol) {
cout << tt.tablee[iRow][iCol];
cout << " ";//This space helps so the numbers can be visable
//to the user
}
cout << endl;
}
}
int main()
{
dfs();
char test_char;
cin>> test_char;
return EXIT_SUCCESS;
}
これをコンパイルできるコードブロック([SSCCE](http://sscce.org))にまとめることはできますか?上記のコードをファイルに入れてmain()を書いて、gccで私のためにコンパイルします – je4d
どのような行がエラーですか、そしてあなたのサンプルはどこですか? – ssube
@ je4d私の編集を参照 –