Hey guys, I'm writing a small program to read in a csv with a variable number of lines and have a question about best practices:
Is the best way to create storage for the data on each line to make an array that holds the data structures of the csv (one per each line of csv)?
Size allocated to the array could be set to a large number (for example, more lines than there would ever reasonably be in the csv)? I have seen this in many examples on the web.
Or... is there was a smart way to tell how much space would be needed such as counting the lines before hand or dynamically adding space by using a linked list as opposed to an array with static storage allocation. Any best practices? I don't think choosing a random number seems very slick...
Any thoughts would be greatly appreciated. Thanks!