How would I add just the columns in this 2-dimensional array?
#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;
const int rows = 5;
const int cols = 5;
int main ()
{
ifstream inData;
int numbers[rows][cols];
int i,j;
inData.open("data.txt");
while (!inData.eof()){
for (i=0; i<rows; i++)
{
for (j=0; j<cols; j++)
{
inData >> numbers[i][j];
cout<<setw(5)<<numbers[i][j]<<" ";
}
cout<<endl;
}
}
return 0;
}