0
Struct Array Error
https://code.sololearn.com/cC5fHLfx39Zs/?ref=app It gives me an error about the "flexible array" in an "otherwise empty struct" Why? What can I do to fix this? What's the easiest way to initialize an array through a constructor?
7 Respostas
+ 3
An additional
T* contents;
?
+ 2
: contents(arg)
Does this work?
+ 2
That worked because unlike in C, [arrays] need a size which is known at compile time. Otherwise, you can make them a pointer, or, even better: use the std::vector class. Google that up if you want to, they're better at explaining than me.
+ 2
Perfect.
0
0
Timon Paßlick thanks!
0
Timon Paßlick I've heard of the vector