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.
SIZEの配列を含む構造体を単純に作成するより良い方法があるかどうか疑問に思っています。
... #define SIZE 100; ... struct foo { foo(); bar * bars; } foo::foo() { bars = new bar[SIZE]; }
コンパイル時定数である限り、SIZE簡単に実行できます
SIZE
struct foo { bar bars[SIZE]; }