Declaring array by int arr[N]; the size N must be determined in compile-time (except for some compiler extensions which allow you to define them in run-time too). By the way, you can make it:
std::unique_ptr arr (new int [n]);
// ... or ...
std::vector arr(n);