title: CX0030: Error: Expression cannot be evaluated
body: <p><strong>I cannot modify the member values of a class object because of the above error:</strong></p>
  
  <p>When I call my initialize function to initialize my "garo" object, I receive the following run-time error, </p>
  
  <p>"Unhandled exception at 0x01323976 in Heretic.exe: 0xC0000005: Access violation reading location 0x00000008."</p>
  
  <p>NOTE: The class Garo is a child of Object.</p>
  
  <p><strong>THE CODE</strong></p>
  
  <p><strong>Garo.h</strong></p>
  
  <pre><code>#pragma once
  #include "Object.h"
  
  class Garo : public Object
  {
  private:
      int animationRow;
  
  public:
      Garo();
      void Destroy();
  
      void Init(ALLEGRO_BITMAP *image = NULL);
      void Update();
      void Render();
  
      void MoveLeft();
      void MoveRight();
      void Idle();
      void SetAnimationRow(int row);
  };
  </code></pre>
  
  <p><strong>Garo.cpp</strong></p>
  
  <pre><code>#include "Garo.h"
  
  Garo::Garo()
  {
      Object::Init(20, 200, 3, 0, 0, 0, 16, 24);
  }
  
  void Garo::Init(ALLEGRO_BITMAP *image)
  {
      Object::Init(20, 200, 3, 0, 0, 0, 16, 24);
  
      SetID(PLAYER);
      SetAlive(true);
  
      maxFrame = 3;
      curFrame = 0;
      frameWidth = 32;
      frameHeight = 48;
      animationColumns = 4;
      animationDirection = 1;
  
      animationRow = 0;
  
      if(image != NULL)
          Garo::image = image;
  }
  </code></pre>
  
  <p>... the rest has been abbreviated</p>
  
  <p><strong>Object.h</strong></p>
  
  <pre><code>#pragma once
  
  #include &lt;iostream&gt;
  #include &lt;allegro5/allegro5.h&gt;
  #include &lt;allegro5/allegro_primitives.h&gt;
  #include "Globals.h"
  
  class Object
  {
  private:
      int ID;
      bool alive;
      bool collidable;
  
  protected:
      float x;
      float y;
  
      float velX;
      float velY;
  
      int dirX;
      int dirY;
  
      int boundX;
      int boundY;
  
      int maxFrame;
      int curFrame;
      int frameCount;
      int frameDelay;
      int frameWidth;
      int frameHeight;
      int animationColumns;
      int animationDirection;
  
      ALLEGRO_BITMAP *image;
  
  public:
      Object();
      void virtual Destroy();
  
      void Init(float x, float y, float velX, float velY, int dirX, int dirY, int boundX,               int boundY);
      void virtual Update();
      void virtual Render();
  
      float GetX() {return x;}
      float GetY() {return y;}
  
      void SetX(float x) {Object::x = x;}
      void SetY(float y) {Object::y = y;}
  
      int GetBoundX() {return boundX;}
      int GetBoundY() {return boundY;}
  
      int GetID() {return ID;}
      void SetID(int ID) {Object::ID = ID;}
  
      bool GetAlive() {return alive;}
      void SetAlive(bool alive) {Object::alive = alive;}
  
      bool GetCollidable() {return collidable;}
      void SetCollidable(bool collidable) {Object::collidable = collidable;}
  
      bool CheckCollisions(Object *otherObject);
      void virtual Collided(int objectID);
      bool Collidable();
  };
  </code></pre>
  
  <p><strong>Object.cpp</strong></p>
  
  <pre><code>#include "Object.h"
  
  Object::Object()
  {
      x = 0;
      y = 0;
  
      velX = 0;
      velY = 0;
  
      dirX = 0;
      dirY = 0;
  
      boundX = 0;
      boundY = 0;
  
      maxFrame = 0;
      curFrame = 0;
      frameCount = 0;
      frameDelay = 0;
      frameWidth = 0;
      frameHeight = 0;
      animationColumns = 0;
      animationDirection = 0;
  
      image = NULL;
  
      alive = true;
      collidable = true;
  }
  
  void Object::Init(float x, float y, float velX, float velY, int dirX, int dirY, int boundX, int boundY)
  {
      std::cout &lt;&lt; "HERE?" &lt;&lt; std::endl;
      Object::x = x;
      Object::y = y;
  
      Object::velX = velX;
      Object::velY = velY;
  
      Object::dirX = dirX;
      Object::dirY = dirY;
  
      Object::boundX = boundX;
      Object::boundY = boundY;
  }
  </code></pre>
  
  <p><strong>The Calling Code</strong></p>
  
  <pre><code>Garo *garo;
  // ...
  garo-&gt;Init(garo_img);
  </code></pre>
  
  <p>This is where I receive the run-time error. I'm using Allegro libraries, so feel free to ask about any weird types you may see. I am stilling learning C++, so please help me to understand in rudimentary terms.</p>