I am working on an application were there are three possible sizes for the data entered:
You can allocate such a big array on the heap:
int *arr;
arr = malloc (sizeof(int) * 500000);
Don't forget to check that allocation succeded (if not - malloc returns NULL).
And as pmg mentioned - since this array is not located in the stack, you have to free
it once you finished working with it.
Your stack can't hold that much data. You have to allocate big arrays on the heap as follows:
int *array = malloc (sizeof(int)*size);
As pmg pointed out remember to free your memory once your done.
free(array);
It's too big for the stack. Instead you need to allocate it on the heap with malloc.