Well trying to conserve memory I'm trying to get my program to only make an array of what is needed nothing more. I've already figured out that the only variable i could use to set how many there is in a array is a const but according the the compiler i use, Visual C++ 2008 Express Edition, it needs to know how big the array is going to be before it's compiled...
Simply, this code:
#include<iostream>
using namespace std;
void main()
{
int c;
cin >> c;
const int a=c;
int b[a];
system("pause");
}
Gives me these errors:
error C2057: expected constant expression
error C2466: cannot allocate an array of constant size 0
error C2133: 'b' : unknown size
If this is already solved on the site please give me the link because i had absolutely no idea on what to search for to find the solution for this...