Random numbers causing problems
<p>Say I have a member variable <code>vector&lt;bool&gt; rightWall;</code>. rightWall has <code>width*height</code> indices. I want to access a random index of rightWall. So I do:</p>

<pre><code>index1=rand()%(width*height-1);
rightWall[index1]=true;
</code></pre>

<p>But I get Valgrind errors: Invalid read of size 8. rightWall was never initialized or anything, and I'm not sure it's really supposed to, since its only bools. What can be the problem?</p>
