I am preparing for a programming competition soon and for one of the sample problems one line of input is the length of the list of numbers and the second line is the actual numbers. this is what i have:
void main()
{
int num;
cin >> num;
int items[num];
}
it wont compile because it says that num is not a constant expression. I tried this:
int numConst=num
and use numConst as the array index but it still says it wont work. Any help?