title: C++ pointer to boolean value
body: <p>I'm having problems trying to implement a class which contains a pointer to a boolean...</p>
  
  <pre><code>class BoolHolder {
      public:
      BoolHolder(bool* _state);
  
      bool* state;
  }
  
  BoolHolder::BoolHolder(bool* _state) {
      state = _state;
  }
  
  bool testbool = false;
  
  BoolHolder testbool_holder( &amp;testbool );
  </code></pre>
  
  <p>If I do this, testbool_holder.state always reports that it is true, no matter whether testbool itself is true or false</p>
  
  <p>What am I doing wrong? I just want the class to be able to maintain an up to date value for testbool but I don't know how to effect this. Thanks</p>