I have a simple function Barthat uses a set of values from a data set that is passed as an array of data structures. Data can come from two sources: a constant initialized array of default values or a dynamically updated cache.
The calling function determines which data is used and should be transmitted Bar.
Baryou don’t need to edit any data and actually never do it. How to declare a Bardata parameter so that I can provide data from a set?
union Foo
{
long _long;
int _int;
}
static const Foo DEFAULTS[8] = {1,10,100,1000,10000,100000,1000000,10000000};
static Foo Cache[8] = {0};
void Bar(Foo* dataSet, int len);
Note: this is C, NOT C ++, if that matters;
, . , ( const?). ?