954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Large Char Array

Hi, i need to make a very large char array (char array[10000000]). How would I do this without getting a stack overflow error?

TheBeast32
Posting Whiz in Training
236 posts since Dec 2007
Reputation Points: 79
Solved Threads: 6
 

You can try taking in a vector char array. That way enough Memory will be allocated depending upon the input .. So you will not need to make such a huge array.

Sky Diploma
Practically a Posting Shark
865 posts since Mar 2008
Reputation Points: 673
Solved Threads: 131
 

allocate it dynamically from the heap, which is usually much larger

bugmenot
Posting Whiz in Training
225 posts since Nov 2006
Reputation Points: 53
Solved Threads: 34
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You