fscanf into a 2d array in C

前端 未结 2 900
旧巷少年郎
旧巷少年郎 2021-01-28 10:12

I want to scan elements from a txt into an array. The txt doesn\'t have how many rows or columns I\'m going to have, it only contains a coordinate, and the elements of the array

2条回答
  •  星月不相逢
    2021-01-28 10:32

    You should use dynamic array allocation to scan elements from an unknown txt file into an array. for C++ programmers the best solution is std::vector. but C programmers should use alternative solutions. please read this post: (std::vector alternative for C)

提交回复
热议问题