Is it possible to make a variable number of variables? For example, let's say I want to declare some unknown number of integers, is there a way to automatically declare the code
int n1;
int n2;
.
.
.
int nx;
where x is a finite number of required variables.
A potential application requiring this will read a CSV file with an unknown number of rows and columns. Right now, the only way I can think of this without a variable number of variables is either a two-dimensional vector, or encoding in more columns than is possible in any input file that the program receives
source
share