### Extremely confused

I am working on my class final project in which we have to make an array and selection sort, but mine isn't working.

 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748`` ``````#include #include #include using namespace std; int selectionSort(int [], int); int main() {srand (time_t(NULL)); int narray[100]; for (int i=0; i<100; i++){ narray[i]=rand()999;} } { const int NUMEL = narray; int nums[NUMEL] = {narray[i]}; int i, moves; moves = selectionSort(nums, NUMEL); cout <<"The sorted list, in ascending order is: \n"; for (i=0; i < NUMEL; i++) cout << " " << nums[i]; cout << endl << moves << " moves were made to sort this list. \n"; return 0; } int selectionSort(int num[], int numel) { int i, j, min, minidx, temp, moves=0; for (i=0; i<(numel-1); i++) { min = num[i]; minidx=i; for(j = i + 1; j < numel; j++) { if (num[j] < min) { min = num[j]; minidx = j; } } if (min < num[i]) { temp = num[i]; num[i] = min; num[minidx] = temp; moves++; } } return moves; }``````
`narray[i]=rand()999;} ` What is this?
I'm trying to fill an array with 100 psuedo-random numbers but within 0-999 range.
this is the error code im getting on line 12:

error C2447: '{' : missing function header (old-style formal list?)
Topic archived. No new replies allowed.