i am trying to read and print from a text file. This code only print one row instead of 5 rows. I have no clue now.
F
F
F
F
F
This is what i am getting but my text file contains
FFRRR
FFRRR
FFRRR
FFRRR
FFRRR
i NEED THIS OUTPUT...
#include <iostream>
#include <string>
#include<fstream>
using namespace std;
int main(){
ifstream file;
int rows = 6;
int col = 5;
// char page;
char file01;
char page[6][5];
file.open("proj1_test1.txt");
while(file >> file01){
for(int i = 0; i < rows; i++){
for(int j = 0; j < col; j++){
file >> page[i][j];
page[i][j] = file01;
}