I was wondering which method I should use to declare a 2D array. First, I was going to declare a 2D array of char arr[15][100]. In each text file, there's a number on the first line, and that displays how many columns are in the text file, so I would save those numbers in another array and whenever I wanted a certain column, I would add that number plus whatever number to the index and I could hold multiple text files of columns in a single character string array.
I was thinking, I could save some of that space if instead of the [100], I dynamically allocated the memory for the second index of the array. This means I would have to read each text file twice though to copy the number of columns first and then add them all up and then use malloc.
So my question is would it be better to go with the [15][100] array at the start, or allocate the memory by reading from each file twice?