A function that will fill an integer array of any size with only the odd random numbers in 1-500 range.
A function that will print an integer array of any size.
A function which will search a passed in integer array of any size and use reference parameters to return the largest and smallest value in a passed in array.
This is not homework, I just want to get myself the concept of Arrays because I am teaching myself. Thank you
function which will search a passed in integar array of any size and uses reference parameters to return the largest and smallest value in the passed array:
But I just want to say sorry since the above code does not compile. Because of complications of passing arrays to functions. But if you read the code carefully you should get the idea.
When passing an array as a parameter... void print_array(int a[])
is exactly the same as void print_array(int* a)
both examples are passing a pointer.
With only a pointer you can't know the size of the array. That's why you see a lot of functions that take another argument that specifies the size. The exception is character arrays that expect the array to be null terminated.