I have just begun to program in C and am trying to write a currency conversion program. I need to populate a 2D array using the values read in from a text file, rates.txt.
The rates are
1
0.99
0.64
121.42
4.65
I assume I must use floating point arrays.
How should I read the values in from the file?
Should I read them directly into the array or into five seperate variables and then produce my 2D array from these five variables?
Or should I read from the file into a 1D array and then produce my 2D array from each member of this array?
I need some guidance as to the best possible method and any help would be gratefully received. Thanks
The rates are
1
0.99
0.64
121.42
4.65
I assume I must use floating point arrays.
How should I read the values in from the file?
Should I read them directly into the array or into five seperate variables and then produce my 2D array from these five variables?
Or should I read from the file into a 1D array and then produce my 2D array from each member of this array?
I need some guidance as to the best possible method and any help would be gratefully received. Thanks