Reputation: 1017
I am wondering if there is a better way to simply create a struct containing an array with a SIZE:
...
#define SIZE 100;
...
struct foo {
foo();
bar * bars;
}
foo::foo() {
bars = new bar[SIZE];
}
Upvotes: 0
Views: 124
Reputation: 143061
as long as SIZE
is a compile-time constant you can simply
struct foo {
bar bars[SIZE];
}
Upvotes: 4