That will require 1.000.000 * sizeof (int) memory, assuming sizeof(int) == 4, you'll need ~ 4 Gb of working memory only for that. Don't you think it's too much?
What do you need that for?
Not 4 Gb, but only 4 Mb. This is quite possible. Most probably, the problem is that you try to allocate the memory in program stack.
Shadox, make the array global, allocate the memory dynamically or increase the stack size with the help of compiler options.