I have been using codeblocks for c++ and it has always let me to do this:
#include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
int v[n];
}
but now when I put this code into visual studio its giving me this error:
expression must have a constant value -- the value of variable "n" (declared at line 7) cannot be used as a constant.
Any idea on how I can fix this, I would really like to use visual studio instead of codeblocks.
Thanks!