Forums » C++ Framework » CCArray or normal array with 300000 elements make app crash »
| sefiroths sefiroths | CCArray or normal array with 300000 elements make app crash | ||
|---|---|---|---|
|
Added by sefiroths sefiroths 11 months ago
hi all, i'm new to android development. char buf[300000][30]; but the app crashes, so i have tried with std::vector<string> array(300000); but crashes however. if i make in iphone the app goes well. how can i manage an array so big? thanks |
||
| Oren Bengigi | RE: CCArray or normal array with 300000 elements make app crash | ||
|
Added by Oren Bengigi 11 months ago
Try splitting it to several arrays. Checkout my game: |
||
| sefiroths sefiroths | RE: CCArray or normal array with 300000 elements make app crash | ||
|
Added by sefiroths sefiroths 11 months ago
ok i'll try. thanks |
||
| James Chen | RE: CCArray or normal array with 300000 elements make app crash | ||
|
Added by James Chen 11 months ago
I think you should allocate memory on the heap rather than the stack. |
(1-3/3)