numerical data into array

Hi, I know this question has been around since forever but because of this I have no clue of which is the correct way of doing the following:
I have a file with numerical data store in columns

1
2
3
4
5
6
7
8
  File
  time voltage current
  1     1.1     0.1
  2     1.2     0.12
  3     1.1     0.13
  4     1.4     0.14
  5     1.2     0.11
  6     1.1     0.12


I want to store this data to some kind of variable: maybe an array[][][] or an array of struct{double a;double b; double c;}. My goal is to have an array of numbers for each column.

Thanks
Im not exactly sure on how to solve this, but What Im sure of is that you do not want to use a
array[][][]
at least 1 array per variable: time[i], voltage[i], current[i].
Actually... A two-dimensional array would work great. Something like

float arr[6][2]

for(int i = 0; i < 6; i++)
{
for(int k = 0; k < 2; k++)
{
//do the shit here
}
}

Edit: Only "downside" I see to this is that 1,2,3,4,5,6 are integers, and its an float array, but I think thats fine.
Last edited on
Topic archived. No new replies allowed.