I\'m working on a small program to help speed up some data analysis for my lab work. It\'s supposed to read in data from a text file, create a bunch of arrays containing thi
You say that you're not comfortable with dynamically-sized arrays, or std::vector
.
I'm afraid that you'll have to figure out how to get comfortable here, because that's precisely what's std::vector
is for.
The only other alternative is to use the gcc
compiler. gcc
does allow you to have variable-sized arrays. It's a compiler extension, it's not standard C or C++:
void method(size_t n)
{
dataPoint array[n];
// Do something with the array.
}