//an example of C++ functions with arrays //csci107, Laura Toma #include const int size=10; //************************************************************ //a function that reads an array of n elements from the user; //when callig the function, n is assumed to be known, while a[] is filled in void read_array(int a [], int n) { int i = 0; cout << "Please enter an array of " << n << " elements: \n"; while (i > a[i]; i = i+1; } } //************************************************************ //a function that prints the array a[] of n elements; ///when callig the function, the array and n are assumed to be known void print_array(int a[], int n) { cout << "the array is: "; //Fill in cout << endl; } //************************************************************ int main() { //declare an array called x of size elements int x[size]; //read the array from user read_array(x,size); //print out the array to user print_array(x,size); return 1; }