I am trying to input a text file, in a similar format to a CSV, into a multi-dimensional array, where every element of the array is an array of words for each line. Any help would be much appreciated!
For example, the file input.txt could contain:
Carrot, Potato, Beetroot, Courgette, Broccoli
Dad's oranges, Apple, Banana, Cherry
Pasta, Pizza, Bread, Butter
The structure of the outputted array I am hoping to get from that would be in the form:
[[Carrot, Potato, Beetroot, Courgette, Broccoli], [Dad's oranges, Apple, Banana, Cherry], [Pasta, Pizza, Bread, Butter]]
So you the line:
printf("%s", inputArray[1][0]);
Would print:
Dad's oranges