I need to print out characters in 6 rows and 5 columns, i got this code so far, when i run it it only print out the char in one column.
void printFile(){
string file= "proj1_test1.txt";
string a = " ";
char page[6][5]= {'A','B','C','D','E','F'};
cout << " What is the name of file to import?" << endl;
cin >> a;
if (a == file){
cout << "file successfully loaded" << endl;
for (int i = 0; i < 6; i++){
for (int j = 0; j < 5; j++){
cout << page [i][j] << " ";
}
cout << endl;
}
}
else{
cout << "The file " << a << " was not opened" << endl;
}
}
Last edited on