   [C++] Weird error
  I'm using Visual Studio 2010 Ultimate. DirectX 9 SDK, also RakNet networking library. But I think these aren't related to the problem.Debugger throws this error:Unhandled exception at 0x5d59ad4a (msvcp100d.dll) in Server.exe: 0xC0000005: Access violation reading location 0x003493c4.Error is showed in xutility file, if I track back, calls go through string header, then into my code:void RPCLogin(RPCParameters *RPC){if(GetIndex(RPC->sender.binaryAddress)>=0) return;BitStream b(RPC->input, BITS_TO_BYTES(RPC->numberOfBitsOfData), false);string acc,pass,file;b.ReadCompressed(acc); //if I comment this line, it's all fine} //shows on this bracket (deconstructor?)Any ideas what wrong? Or maybe some information missing?Thank you in advance.Edit:If I build in release mode, not debug, there's no error and everything works fine.   
  Looks like ReadCompressed() is causing you to read past the end of an array, or reading an invalid pointer in your BitStream class.   ;  I tried debugging, 'acc' string was right, without any artificials. However if I set value manually, not read from BitStream, there's no error. Any way to identify what's the problem exactly?   ;  I know nothing about RakNet's BitStream, but from looking at the docs...Quote:From RakNet docstemplate<class templateType> bool RakNet::BitStream::ReadCompressed(templateType &var)Read any integral type from a bitstream....I would seriously question whether it is possible to pass something like a std::string to the function. I'd suspect the function internally does something like write_to(&t,sizeof(T),data) which simply won't work for a non-POD type.   