I have a .csv file of fields to be read as integer,string,integer. I don't know size of strings and they may vary at different entries in csv. eg:
1,Hello,10
2,hi,20
Here Hello
and hi
are of different length, so how to dynamically allocate the size of string while reading from file using malloc?
Can anyone help me with its syntax, starting from declaration till using malloc to allocate size.
my output should look like,it is reading the integer, string, integer from .csvfile and display all the strings in the file.
The number of entries in the file can tens of millions.