I wrote the following code which attempts to allocate memory for a two dimensional array of known dimensions: As you see, I got a not-so-helpful error message. Thanks to Kenan (link only works on IE) and after some research (see links below) I found out that the stack has limited size and I should use the heap for large memory allocations. Normally, I would do that for dynamic arrays, not static arrays. So I rewrote the code and it worked: The main disadvantages of using the heap are:
* Variables created on the heap must be manually deallocated. Variables created on the stack will go out of scope and automatically deallocate.
* Heap is slower than the stack

* What and where are the stack and heap
[null, {"document_url": "http://samilkorkmaz.blogspot.com/2011/07/heap-stack.html", "unformatted_src": "http://1.bp.blogspot.com/-gCa-F_CaeB4/Tg287HuF9oI/AAAAAAAAPRM/kEPPCseZhBY/s400/stackheap1.PNG", "src": "http://1.bp.blogspot.com/-gCa-F_CaeB4/Tg287HuF9oI/AAAAAAAAPRM/kEPPCseZhBY/s400/stackheap1.PNG", "formatted_filename": "stackheap", "rendered_width": 381, "rendered_height": 400}, null, {"document_url": "http://samilkorkmaz.blogspot.com/2011/07/heap-stack.html", "unformatted_src": "http://4.bp.blogspot.com/-mul4WEO0EJI/Tg29GsIM3TI/AAAAAAAAPRQ/DpLx2Cgh-fo/s400/stackheap2.PNG", "src": "http://4.bp.blogspot.com/-mul4WEO0EJI/Tg29GsIM3TI/AAAAAAAAPRQ/DpLx2Cgh-fo/s400/stackheap2.PNG", "formatted_filename": "stackheap", "rendered_width": 400, "rendered_height": 136}, null, null, null, null, null, null, null, null]