I am facing a problem with allocation of two dimensional char array. The problem statement requires me to get the number of rows and columns of the array from a file. I have saved the rows in "rows" and columns in "columns", both of type int.
Here is how i initialized the array.
array = new char [rows][columns];
The error I get is "non constant expression as array bound".
I know what constant expression means. But I am unable to figure out the way to make a 2d dynamic array by getting its size from the file.
Please help me with this thing.
I will appreciate this if you tell me how to make a dynamic 2d char array by getting the size of it from a file.