私はこのようなものを持っています:
typedef int customType[10];
そして、私はこのような機能が欲しい
std::vector<customType*>& myFunc();
しかし、いくつかの問題があります。
1)ベクター内のすべてのポインターにメモリを割り当てる必要がありますcustomType
(そうですか?)そして、
std::vector<customType*> A;
//some code to get length
for (i = 0; i < length; i++)
{
A[i] = new customType;
}
エラーのために間違っています:
IntelliSense: a value of type "int *" cannot be assigned to an entity of type "customType*"
2)一般的に、そのようなデータを保存するのは良い方法ですか?たぶん、すべてを1行に格納して1次元の配列を作成し、次のようなものを使用する必要があります
A[i*innerLength+j]
要素にアクセスするには?