The name of an array is also a pointer to the first element of the array. You can use this pointer to pass the array into functions, or to access the array in any other way you need. Thus, you only need:
void math(double* model)
as shown in MiiNiPaa's code.
However, when you pass the array (i.e. the pointer) into the function, there is no way for the function to know the size of the array. It is customary, therefore, for a function that takes an array in the form of a pointer, to also take the size of the array as a separate parameter:
1 2 3 4 5
|
void math(double* model, unsigned int modelSize)
{
for (x = 0; x<modelSize; ++x)
model[x] = 1.23453+x;
}
|
This allows the function to handle arrays of any size, without making assumptions about what that size will be.
EDIT: Of course, most people will tell you that the very best thing you can do is to learn how to use vectors as soon as possible, and use them instead of arrays wherever possible. Those people are 100% correct.