Performance impact of realloc ()

前端 未结 4 2155
感情败类
感情败类 2021-02-18 15:41

I have a list of records, at the starting I dont know the number of records. I need to read them into array. so is it advisable to read all record one by one & doing reallo

4条回答
  •  深忆病人
    2021-02-18 16:27

    You could also consider using a linked list instead of an array for your task if it is possible. It will require only malloc to add new elements.

提交回复
热议问题