The following C++ program has error. Please i need help.
//Error Message: (./vpl_execution: line 2: 26145Segmentation fault (core dumped)./BoatPlane)
#include <iostream>
#include <fstream>
#include <stdint.h>
using namespace std;
void Merge(int *a, int low, int high, int mid);
void MergeSort(int *a, int low, int high);
void SelectionSort(int *a, int low,int high);
void swap(int *x, int *y);
int main (){
ifstream file;
fstream outfile;
int n=5001025;
int array[n];
uint32_t a;
file.open(“threesData.bin”,ios::binary | ios::in);
if (!file)
{
cout << “Error opening filen”;
}
int count = 0;
while (!file.eof()){
file.read(reinterpret_cast<char *>(&a),sizeof(a));
count++;}
file.close();
MergeSort(array,0,count-1);
// print the array elements to file
for(int i=0;i<n;i++ ){
outfile.open(“sortedThreesData.bin”, ios::out |ios::binary);
for(int i=0;i<count;i++ ){
outfile.write(reinterpret_cast <char *> (&array[i]),sizeof(int));}
outfile.close();}
return 0;}
void Merge(int *a, int low, int high, int mid)
{
// We have low to mid and mid+1 to high already sorted.
int i,
PayPal Gateway not configured
PayPal Gateway not configured