开发者

Reading file into array

I have these a file in a c program w开发者_运维知识库hich consist of a string and 4 doubles and 2 integer in one line and there is a total of 28 lines, i want to read this file and load the data into an array. can someone help me solve this.


Split up your problem into sub-tasks:

  • Open the file using fopen
  • Allocate a buffer (array) to store the doubles
  • Create a loop while there is more to read
  • read in a single double into the array
  • Go to the next iteration
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜