4;3,2,5,6
2;1,5
3;4,6,8
.... (has an unknown amount of rows in the txt file)
The first value of the row is the array size and the values that follow is the values in the array. I would like to step through each row and do calculations with each array the row creates but I am unsure as to how because of that first value (size of the array). I want to use pointers to make these dynamic arrays of specific size as well.
I want to use pointers to make these dynamic arrays of specific size as well.
It seems you are using C++ so don't use dynamic arrays.
The best solution is to use std::vector<std::vector<int>>
In this way you don't have to worry about memory management.
I would have liked to use arrays because I am unsure on how to do certain calculations or operations using vectors like how to find the highest value in the vector and if the highest value is odd to square all the values in the vector and then display it
Doing it with a vector is no different to doing it using an array - use the same syntax.
In mycode vi.size() gives the number read. Note that there are std functions to determine min/max etc. However, for things like min/max you'd probably determine this as part of reading the data - not as a separate process after the data has been read.