Warrior Forum - The #1 Digital Marketing Forum & Marketplace

Warrior Forum - The #1 Digital Marketing Forum & Marketplace (https://www.warriorforum.com/)
-   Programming (https://www.warriorforum.com/programming/)
-   -   Maximum char array size (https://www.warriorforum.com/programming/1219623-maximum-char-array-size.html)

NicoleJS 21st September 2016 02:29 AM

Maximum char array size
 
Hello I am trying to declare a char array of size of approximately nineteen million of positions and I am receiving a Segmentation fault when running my program. The declaration is the last thing of the program.

So what it is the maximum size I can use?
Should I use dynamic memory allocation? Or maybe a vector?
In this case what is the better option. I know in advance the size of the array, that's why I tried to use one and not a vector.


EDIT: I made I mistake, I only needed an array of 1/8 that size, and it worked just fine with this new size. But for future use, my question is the same. What is it the maximum size, should I use dynamic memory or a vector?


All times are GMT -6. The time now is 04:25 PM.