I have a file that is formatted in a certain way. Here is an example:
"input.txt":
1 2 3 4
6 3
A B C D E F
G H I J K L
M N O P Q R
The first two numbers at the top are the width and height of the matrix of characters. I want to make an 2-dimensional array for these chars, with the 2 numbers at the top as the dimensions of the array. So for example, in this file I would want
char[6][3] charMatrix
I've tried using this code:
1 2 3 4
ifstream fin ("input.txt");
int width, int height;
fin >> width >> height;
char charMatrix[width][height];