Whenever I tell it to print out what is in my array it prints out a memory address. I am a beginner.
#include <iostream>
#include <cstdlib>
#include <algorithm>
using namespace std;
int main()
{
const int Array_Size = 6;
int The_array[Array_Size] ={ 30, 60, 20, 50, 40, 10 };
for(int starting_index = 0; starting_index < Array_Size; starting_index++)
{
int smallestindex = starting_index;
for (int current_index = starting_index + 1; current_index < Array_Size; current_index++)
{
if (The_array[current_index] < smallestindex)
{
smallestindex = current_index;
}
swap(The_array[current_index], The_array[smallestindex]);
}
cout<<(The_array);
}
cin.get();
system("pause");
return 0;
}