There are two options that appear immediately.
First, use std :: vector. A vector works basically the same as an array (except for the syntax for declaring and calling) on ββthe surface. The 2 things you want to know about vectors is that you can call a function that will increase the size of your vector (add indexes at the end). Another thing is that to create a two-dimensional vector you will need to declare a vector of vectors. It also allows you to have more than 2 values.
Another thing you can use is std :: list. This is just a linked list into which you can insert and delete items.
user381261
source share