Array size of 1000000

in the prime sieve video. bhaiya has taken the size of array to be 1000000 while in my program, i took size from the user and then declare the array. is this method better than the 1000000 wala method?

Hi Raghav, C++ standard (till C++11) doesn’t support variable sized arrays. The C++11 standard mentions array size as a constant-expression. So the above program may not be a valid C++ program. The program may work in GCC compiler, because GCC compiler provides an extension to support them.