c++ - C++Builder program does not run (but if I delete file.close() line it does!) -


i'm developing first game application since winter, , meet 1 strange problem.

using embarcadero c++ builder xe app compiled , ran, today fails start, still compiled successfully!
press "run" usual, see console output "success elapsed time etc" , - nothing. app's window not appear.

i figured out problem in code:

ifstream file; file.open(filewithtextureprop, ios::binary);  int length; char * buffer; // length of file: file.seekg (0, ios::end); length = file.tellg(); file.seekg (0, ios::beg);  // allocate memory: buffer = new char [length+1]; buffer[length] = '\0';  // read data block: file.read (buffer,length);  xml_document<> doc; doc.parse<0>(buffer);  /*  xml parsing here, if delete or comment - nothing changes    */  delete[] buffer;  file.close(); // note: if comment line - program starts (!) 

what doing wrong?


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -