I am very new to programming(2nd project) and cant figure out how to cout my selection sort so that my array passes through it and then prints out in a sorted array. What i get with this code is around mostly numbers in the -80,000s and the range should be from 0 to 100. Anyone see anything wrong with my code?
#include <iostream>
#include <ctime>
using namespace std;
[code]void selectionsort(int array1[], int array_size)
{
for(int i = 0; i < array_size; i++)
{
int currentMin = array1[i];
int currentMinIndex = i;
int main()
{
// this is for the 100 number random array needs to be in a function
const int array_size = 100;
int array1[array_size];
srand((unsigned)time(0));
um that was my attempt to sort the array before couting it as i have no idea how to pass the array into the selection sort and then have it cout as a sorted array.