Alright so I did as you suggested and it compiled just fine but when I ran it it created the output file but the file size was increasing at an astronomical rate(when it crashed it was at 300mb). Is this an infinite loop of some sort?
Code:
#include <iostream>
#include <string>
#include <fstream>
#include <sstream>
#include <cstdlib>
#include <vector>
#include <list>
void bubbleSort(int numbers[], int array_size);
int main( )
{
using namespace std;
ifstream in_stream1;
ofstream out_stream;
ifstream in_stream2;
in_stream1.open("prob2list1.txt");
in_stream2.open("prob2list2.txt");
out_stream.open("prob2merged.txt");
int numbers[2000];
int array_size;
int num;
int i,j;
while(i<2000)
{
in_stream1>>num;
numbers[i]=num;
i++;
}
bubbleSort(numbers, 2000);
while(j<2000)
{
numbers[j]=num;
out_stream<<num<<"\n";
}
return 0;
}
void bubbleSort(int numbers[], int array_size)
{
int i, j, temp;
for (i = (array_size - 1); i >= 0; i--)
{
for (j = 1; j <= i; j++)
{
if (numbers[j-1] > numbers[j])
{
temp = numbers[j-1];
numbers[j-1] = numbers[j];
numbers[j] = temp;
}
}
}
}