This is my project:
Read the data one line at a time and store them in two different arrays.
Pass the first array to a function that sorts the array in ascending
order using selection sort.
Pass the second array to a function that sorts the array in descending
order using selection sort.
(Use your functions from the previous assignment to sort.)
Print each array before and after sorting.
***my main problem is that im having much trouble reading the numbers from the .dat file and storing them in an array, any help you could give me would be great...thanks
void ascendingsort(int list[], int length)
{
int index, smallestindex, minindex, temp;
for (index = 0; index < length - 1; index++)
{
smallestindex = index;
for (minindex = index + 1;minindex < length; minindex++)
if (list[minindex] < list[smallindex])
smallestindex = minindex;
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.