Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私が持っている場合:
int **p;
なぜ私はこれを行うことができないのですか?
p = new *int[4];
しかし、私が持っている場合:
class T {...} T **c; c = new *T[4];
あれは正しいですか?
いいえ、正しくありません。
type-nameの後に指定する*必要があります。
*
次に、次のようになります。
p = new int*[4];
と
c = new T*[4];
newキーワードをタイプ (intまたは) で乗算しようとしていますT! newへのポインタの配列が必要だと言うにはint:
new
int
T
またはへのポインタの配列T:
c = 新しい T*[4];