You have
int array[] = { 1, 2, 3, 4 };
foo( array );
or
boost::array<int,4> arr = { 1, 2, 3, 4 };
foo( array );
There is no way to "new" an array and initialize in the same line of code.
I originally wanted to know because I made a class:
which held a
string*
then another
class OPTIONLIST { ... };
that held
OPTION*
Then I have a global array
OPTIONLIST* oBASE = { ... };
since I need to declare about 30 instances OPTIONLIST everything it became very difficult to do it cleanly.
Thanks anyway...
Last edited on