How do you size an array using a variable?
For some reason, I cant get it to size any kind of array using a variable, giving me a compile time error relating to constant integers.
int Array[10]; //works
int size = 10;
int Array[size]; //fails
const int size = 10;
int Array[size] ; //works
int size = 10;
const int mysize = size;
int Array[size]; // fails
This is part of a larger HashTable class, I've finished the more complex algorithms for it, but cant get this simple thing to work.
For some reason, I cant get it to size any kind of array using a variable, giving me a compile time error relating to constant integers.
int Array[10]; //works
int size = 10;
int Array[size]; //fails
const int size = 10;
int Array[size] ; //works
int size = 10;
const int mysize = size;
int Array[size]; // fails
This is part of a larger HashTable class, I've finished the more complex algorithms for it, but cant get this simple thing to work.