#include
#include
#include
#include
#include
using std::ifstream;
using namespace std;
Because it expected a constant expression!
Array dimensions in C (ignoring C99's VLAs) and C++ must be quantities known at compile-time. That doesn't mean just labelled with const: they have to be hard-coded into the program.
Use dynamic allocation or std::vector (which is a wrapper around dynamic array allocation) to determine array sizes at run-time.