I am trying to store a string data file into a multi-dimensional array using C.My sample data looks as below.I am thinking to use below char declaration for storing my data.Please kindly advise me if there is any other method.
char *array[6][10];
53,v42,p11,51097,310780,ok
56,v45,p11,260,1925,ok
68,v42,p11,51282,278770,ok
77,v50,p11,46903,281485,ok
82,v46,p12,475,2600,ok
84,v48,p12,433,3395,ok
96,v49,p14,212,1545,ok
163,v50,p20,373819,1006375,ok
204,v50,p26,36917,117195,ok
241,v70,p33,21777,91360,ok
I hope this sample program will help you to address your issue. I used structure and sscanf. This is the nice way to address this issue.
$> a./exe < file
$> cat file