POV-Ray : Newsgroups : povray.off-topic : You lose some... : You lose some... Server Time
6 Sep 2024 21:20:42 EDT (-0400)
  You lose some...  
From: Orchid XP v8
Date: 4 Oct 2008 14:37:18
Message: <48e7b7de$1@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.