, but for some reason GNU GCC is giving me errors.
What's the proper way of inputing size of array from text file without messing up size of elements? For the moment I'am not interest in memtest and similiar more complex ways of doing it, let's keep it simple, thanks.
is not standard C++. gcc allows it as extension to support C99 features. I suggest to turn it off in compiler settings if you want to write portable and standard compliant code.
Proper C++ way will be use of standard containers, for example std::vector<int>
If you insist on arrays you can dynamically allocate your array: int* arr = newint[n];. Then iterate over it and set all elements to 0: for(int i(0); i < n; ++i) arr[i] = 0;. Do not forget to delete your array when you done with it: delete[] arr;
Also you could wait for C++14, partial valarray support and dynamic_array type :)