"Segmentation fault" while running code, how can I increase the stack size?
My problem: I have two c++ codes, one with an array size of ~100,000, the other with ~1,500,000. When I compile them using terminal g++ -o commands, the smaller one works with no problem (it takes less than a minute to run), the larger one gives "Segmentation fault". I think it is a memory allocation problem and I am not an expert on dynamic memory allocation which I want to avoid for now.
My question: When I compile the large code in Windows Visual Basic, I can go to settings to increase the stack and heap sizes and it does work. Is there a similar thing in OS X Leopard? I found some commands to do that in the terminal window but I wasn't able to resolve my problem.
Thanks for all your help.
13" MacBook, Mac OS X (10.5.6), 2.2 Ghz Intel Core 2 Duo 2GB 667 Mhz DDR2 SDRAM