P
P
pshevnin2021-11-22 21:09:37
C++ / C#
pshevnin, 2021-11-22 21:09:37

Which list to use?

Good afternoon, I am writing a term paper in C. You need to read data from a document. The data has a format (index, x-coordinate, y-coordinate), but it is out of order. I do not know in advance the number of lines in the document
. I need some kind of list so that I can store these structures under indexes, and add them to the list at a specific place. Would a dynamic array work? If it does, then how to use it correctly in my case?
For example: I'm reading the first element from the document, its index is 15, so I want to add its structure to the 15th place in the array, the next index is 10 for example, and so on.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
Wataru, 2021-11-22
@pshevnin

fit.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question