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.
fileOutput.write(reinterpret_cast<char *> (&myObjects[i]), sizeof(MyClass));The process of writing to the file does not change when changing the members of the class (although if I wanted to read object data from the file after adding/removing member variables I would be unable to do so). I obviously cannot usestd::vectorin the same way that I cannot usestd::stringbecause they do not directly contain the data I want to write, instead they are more complex and contain pointers to the actual data I want, etc.