C++ does not support dynamic sizing of static arrays (Which is why they are called static arrays). You could either use a dynamic array (Using the new operator and pointers):
int a = myfunction.Count(); int* myArray = new int[ a ];
Or you could bypass arrays altogether and go with the STL:
#include <vector>
int a = myfunction.Count(); vector<int> myVector(a);
I'm pretty sure both of these options compile and work... Alas, I could be wrong, but still, try 'em out.
Array Sizing issue
Adhisuma
So either use new/delete, or check if you can use alloca
Phil Pownall
int a = myfunction.Count();
int* myArray = new int[ a ];
Or you could bypass arrays altogether and go with the STL:
#include <vector>
int a = myfunction.Count();
vector<int> myVector(a);
I'm pretty sure both of these options compile and work... Alas, I could be wrong, but still, try 'em out.