In my text file, there are random binary numbers written in a 10x10 matrix. I want to print them in C exactly as they appear in the text file. So I made my code like this:
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main() {
char number[100];
FILE *mz = fopen("maze.txt", "r");
while (!feof(mz)) {
fscanf(mz, "%s", number);
printf("%s\n", number);
}
fclose(mz);
}
But the outputs were 100x1 matrix, not 10x10. What should I do to print an ordinary 10x10 matrix?