-
arrays
i'm writing a program that stores words in a two dimensional array. my program works fine if i use this array[4000][30], however i want to store a lot of words in this array and if i try and make it bigger......say array[10000][30] then it doesnt work right. any idea of why this might be?
-
Why do you need such a large array anyways? array[10000][30] would take up 300KB of memory.
-
because i'm downloading words from web sights and if its a fairly large websight then it will have a lot of words on it.
-
Why don't you just write the words to a file? What are you planning on doing with the words after you retrieve them? We need more info.
-
-
what do you mean off the heap
-
Using the heap instead shouldn't make a difference, you'll have the same problem. Use virtual memory.
-
he means you are declaring your array on the stack. A large array like that causes a stack overflow- not a good thing- and so you should use some sort of dynamic memory allocation.
You will need to use new/delete or new[]/delete[] or malloc()/free().
Making dynamic 2d arrays has been done many times so if you search the c++ boards you will come up with an example.