Cant get my matrix to print correctly

Started by
0 comments, last by Yeshu 14 years, 9 months ago
My matrix wont print correctly Im loading it from a dat file and all i get our empy spaces. Can anyone help? #include <iostream.h> #include "apmatrix.h" #include <fstream.h> #include<iomanip.h> int x; int y; char secret; apmatrix <char> matrix(6,6,0); int main() { ifstream infile; ifstream infile_alpha; infile.open("alpha.dat", ios::in); for(x=0;x<=5;x++) { for(y=0;y<=5;y++) { infile_alpha>>secret; matrix[x][y]=secret; } } cout<<setw(3); for(x=0;x<=5;x++) { for(y=0;y<=5;y++) { cout<<setw(3)<<matrix[x][y]; } } system("PAUSE"); return 0; }
Advertisement
figuredit out

This topic is closed to new replies.

Advertisement