First of all, you can pass an array to a function, like so:
1 2 3 4 5 6 7 8 9 10 11 12
|
void function(int array[], const unsigned short size) {
/**/
}
int main() {
const unsigned short size = 10;
int array[size];
function(array, size);
return 0;
}
|
The way you have it, your fill_numbers() function creates a temporary array of ten integers. The array ceases to exist after the function is done, so anything you've done to the array was pointless, and you're unable to use the same array elsewhere in your code.
It would make more sense if your fill_numbers() function took an array parameter, as well as a size parameter (number of elements).
Also, keep in mind that array indecies begin at zero, so that makes some of your for loops dangerous, since they're accessing memory that's not part of the array.
To iterate through an array of ten elements, something like this would be safe:
1 2 3
|
for(int i=0; i<9; ++i) {
/**/
}
|
Finally, accepting input where uppercase and non-alphabetic characters are important is scary. "Odd Indecies" is not the same as "Odd indecies", which is also not the same as "odd Indecies" or "odd indecies".