C++ BubbleSort Help

Write a program, which will ask the user how many whole numbers they wish to enter. The program will then read that many numbers, print them in the order they were entered, sort them in order by increasing value, and print them in sorted order.

All numbers entered and displayed will be integer values.

All numbers must be validated upon entry.

The maximum number of integers to be handled will be 20.

Sorting will be done in a function where the array will be the first parameter and the number of integers entered into the array will be the second parameter.

Use an array to store the integer values.

Use the bubble sort algorithm provided in class.

Main.cpp File
#include <iostream>
#include "Bubblesort.h"

using namespace std;



void main() {
int Num;
char Array[20]; // this should be an int, however when i change it to int, errors occur at bubblesort.
//Program runs, up until it sorts when Array [20] is a char, the numbers are into characters and then blows up.


cout << "How many numbers would you like to enter?" << endl;
cin >> Num;

cout << "Enter your numbers:" << endl;
for (int i = 0; i < Num; i++) {
cin >> Array[i];
}


cout << "Here are the numbers you entered:" << endl;
for (int i = 0; i < Num; i++) {
cout << Array[i] << " ";
}
cout << endl << endl;

BubbleSort(Array); //bubblesort is a char, so i get a int incompatible with char error
// This bubblesort function was given to us be the professor to use for this lab

cout << "Here are your sorted numbers:" << endl;
for (int i = 0; i < Num; i++) {
cout << Array[i] << " ";
}
cout << endl;
}
/////////////////////////////////////////////////////////////////////////////

So pretty much, I believe my code is correct minus the issue noted above. Can anyone help? Can provide the header file and other .cpp file i have, prefer not to post my entire code on the web.

Thanks for any and all help!
bubblesort.h not a file when I run it?
Bubblesort.h

#ifndef BUBBLE_SORT_H
#define BUBBLE_SORT_H

void BubbleSort(char[]);

#endif
Topic archived. No new replies allowed.