The reason why is you are getting a undeclared identifier error is because you are defining your function after the main() function. Remember that code runs top to bottom. In the example anything below line 13 the main function doesn't know exists unless you have a forward declaration before it or defined it before it.
For example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// Forward declaration of the function
int populate(double array1[], int number);
int main()
{
...
...
}
// Actual definition of the function
int populate(double array1[], int number)
{
...
...
}
On line 8 and 9 you are missing semi colons to terminate the statements.