You're right, in VS2012 it doesn't compile but in Code::Blocks it does. I'm not educated enough to say why but you need a constant expression to initialize an array, or like Ispil said, dynamic memory to allocate it at runtime:
int *pA = newint[amount]; // don't forget to delete[] it when you've finished with it
Also I'm not sure what purpose int w = 0; is serving as it is unused.
Yeah, now that I look at it, there are a few useless things in the code! Thanks Ispil and Codeez! I'm going to google more information on constant expressions and dynamic memory.