Hmm, and I though everything was going so well. :-/
OK, any C++ experts have any idea why this code snippet causes my
program to crash at runtime?
typedef std::vector<bool> Codeword;
std::string codeword(const Codeword &c)
{
std::string out;
for (unsigned int i=0; i<c.size(); i++)
if (c[i]) out.append("1"); else out.append("0");
return out;
}
"Unhandled exception at 0x00414166 in Huffman01.exe: 0xC0000005: Access
violation reading location 0x00000004."
The code looks fine to me - but what I do know?
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|