I have a fixed-size array declared:
int vals[25];
And I'd like to send the array to a function which will assign the values of vals:
bool FetchValueArray(char* source, char* name, char* typeFormat, int count, void** destination)
{
int i;
char *t;
t=strstr(source,name);
if (t)
if (destination != NULL)
{
for (i = 0;i < count;i++)
sscanf(t,typeFormat,destination[i]);
return true;
}
return false;
}
This will essentially read everything at after a certain search string. For example:
FetchValueArray(source,"CONFIG=","%d",15,vals);
Where "CONFIG=" is in plain text, followed by 15 tab separated numeric values.
There's something here I'm far from grokking about indirection and fixed aized arrays thus I'd like to know if a fixed sized array can be sent as a parameter as void** (even if there is the leap of faith that the size of the array will be respected. Different issue.)
tl;dr version
int vals[25];
bool foo(int size,void** d);
foo(25,vals);
Why is this not allowed?