I know that the amount of memory that compiler gives for creating an array has limits. How can I configure my compiler to increasing this memory. And if it is possible, what are the advantage and disadvantages?
I use linux and g++ compiler.
I know that the amount of memory that compiler gives for creating an array
Share
If you are talking about the stack size, it depends on the System you are using. Since you said to be on linux you can change the stack size from your program. However beware that this is not portable to other OS. To change the stack size you can use this function (More or less copyied from here)
Note it is a minimalistic function and you probably want to add your own error messages, instead of just returnen TRUE/FALSE.
The advantage of incresing your stack size, is simply that your programm does not crash if you try to put more variables on the stack than your stack size allows. The disadvantage is that this space is always occupied by your program regardless if it is actually used or not. (Your OS however can trick a bit)