Im trying to use a bubble sort with a 2-d array
my code reads the array but im getting a error at the bottom
invalid conversion from int to int...i have no clue y....heres my code
#include <iomanip>
#include <cmath>
#include <ctime>
#include <fstream>
#include <iostream>
using namespace std;
int main()
{
const int N = 5;
const int K = 4;
const int START = 0,END = 20,SIZE = 30;
int **A;
A=new int *[N];
int temp;
int i,j;
ifstream infile ("BS.DAT");
cout<<"Matrix A"<<endl;
cout<<endl;
for (int i=0; i<N; i++)//generates the matrix A
{
A[i]= new int [N];
}
for (int row=0; row<N; row++)
{
for (int col=0; col<K; col++)
{
infile >>A[row][col];
}
//cout<<endl;
}
for (int row=0; row<N; row++)
{
for (int col=0; col<K; col++)
{
cout<<setw(10)<<A[row][col];
}
cout<<endl;
}
infile.close();
for (i = START; i <END;i++)
{
for (j = START;j<END-i-1;j++)
{
if (A[j] > A[j+1])
{
temp = A[j+1];
A[j+1] = A[j];
A[j] = temp;
}
}
}
system("pause");
return 0;
}