Array initialization

 

Hello,

am I missing something or is it not possible in a class to initialize an array as follows:

In class_A:

class_B b;

double Arr[] = {b.value, ....};

What works is:

In class_A:

class_B b;

double Arr[0] = b.value;

Is there any work around there?

Since I have quite a decent amount of large arrays the first method of initializing the arrays would be much nicer...

 
algotrader01:

Hello,

am I missing something or is it not possible in a class to initialize an array as follows:

What works is:

Is there any work around there?

Since I have quite a decent amount of large arrays the first method of initializing the arrays would be much nicer...

Maybe this might be possible using pointers? I just did a bit of try and error but did not work out. However, I am not really into using pointers at the moment...