Question
I need to read from a csv file in C. The file contains of 'n' number of lines which is unknown. The first integer in
I need to read from a csv file in C. The file contains of 'n' number of lines which is unknown. The first integer in each line is a serial number from 1 to 'n' which is followed by 12 decimal numbers. The contents of csv file appears like :
1,0.4735838,0.2188502,0.3218017,0.3908641,0.8747335,0.8661728,0.7645371,0.7671346,0.607022,0.2362864,0.7524279,0.1373587 2,0.4587781,-0.6874146,0.0585485,0.0981094,0.7597714,0.3514413,0.3402567,1.009966,0.0289762,0.1513164,0.4348733,0.113073 3,0.128609,0.8866994,0.0304762,0.1793496,0.4125913,0.5130338,0.2015045,0.9654949,0.5079429,0.8854641,0.8281798,0.5769543
I want to store this in a 2d array. Please write the code with comments explaining how it can be handled. Thanks in advance.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started