The probability of you being allowed to have four million ints on the stack is zero. If you need four million ints, you will have to manage that memory yourself (with malloc/free/and friends).