|
|
|
|
int a[] = { 3, 7, 5 ... }; , start implementing showArray() and call it from main()
|
|
|
|
int array[25]; -- setting aside space without initializing anything, since your next lines will do the filling.return -1; so that they do the bare minimum to compile. |
|
| std::cout << firstMinusLast; |
| int firstMinusLast ( int a[ ], int size ) { int first = -1, last = -1; for (int i=0; i<size; i++) { if (a != rand[i]) continue; if (first == -1) first = i; last = i; } if (first != -1) cout << "First minus last = " << first-last; } |