Right, having looked up this issue, I believe that it is caused because I have in my class definition wchar_t downloadedText[400000];
I have read solutions about how I should deal with this by using the new
operator to assign the space, ie:
wchar_t *downloadedText;
downloadedText = new wchar_t[400000];
However I need to write instances of the class to a file, and assigning the variable like above appears to use pointers to point to data stored in a way that does not get written to my file. It is this same reason why I cannot use std::vector
.
I have read that another option I may have is that I can increase the size of the 'stack'. I use VS2010 as my IDE, and I located in my project properties > Linker > System 'Stack Commit Size', 'Stack Reserve Size', 'Heap Commit Size' and 'Heap Reserve Size' fields, but I am unsure if this is how I can deal with my issue, and if it is, what to correctly set the appropriate fields to.