I'm new to C and am trying to wrap my head around using malloc. I get the importance of using/freeing them but I can't seem to grasp on how to allocate and access them.
Let's say I have a table containing 2 columns of strings with a max width of 10 for column 1 and 8 for column 2. And let's say the number of rows is 3 like the example below. How do I go about creating a malloc to hold the table of values and how do I access it's respective values?
["Turquoise"]["color" ]
["Tornado" ]["weather"]
["Triangle" ]["shape" ]
Any help in illuminating this is much appreciated.