Course Solutions Uncategorized (Solved) : Following C Program Error Please Need Help Error Message Vplexecution Line 2 26145 Segmen Q29604751 . . . .

(Solved) : Following C Program Error Please Need Help Error Message Vplexecution Line 2 26145 Segmen Q29604751 . . . .

 

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,

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Solved) : 4 Electronic Device Works Based Photo10p Electric Effect Absorption Photons O Transistor O Q32707589 . . . .(Solved) : 4 Electronic Device Works Based Photo10p Electric Effect Absorption Photons O Transistor O Q32707589 . . . .

<br/><img src="https://media.cheggcdn.com/media%2F4b2%2F4b2a37e4-6f38-4e36-ad9b-c1784aa068ba%2Fimage.png" alt="4. What electronic device works based on the photo10p electric effect (absorption of photons)? O Transistor O Solar cell O LED O Diode O DC Source/battery 5. Resistivity