title: trying to call class function character.Draw(buffer)
body: <p>im doing a project at the moment and trying to draw_sprite(example.bmp,NULL) to the screen via a class function of Character.Draw(Buffer).
  It keeps crashing and would like to know why it doesn't work. It works when im not using the class function.</p>
  
  <pre><code>        //Character.cpp
      #include "Character.h"
  const int scrx = 640;
  const int scry = 480;
  
      Character::Character(){
  
  x = 10;
  y = 10;
  velx = 0;
  movespeed = 5;
      gun = load_bitmap("gun.bmp",NULL);
  
       }
  
      void Character::Draw(BITMAP * buff){
  draw_sprite(buff, gun, 10,10);
   }
  
  
       //Character.h
  
       #ifndef CHARACTER_H
       #define CHARACTER_H
  
  
       #include &lt;allegro.h&gt;
  
       class Character{
  
       public:
          Character();
  
     ~Character();
  
  
           void Draw(BITMAP *buff);
       private:
       BITMAP * gun;
  
  
       };
  
      //main.cpp
           #include &lt;allegro.h&gt;
           #include "Character.h"
            using namespace std;
  
            Character character;
  
            int main()
             {
  
  allegro_init();
  install_keyboard();
  
  
  set_gfx_mode(GFX_AUTODETECT_WINDOWED, scrx, scry, 0, 0);
  
  
  
      while(! key[KEY_ESC])
      {
  
          switch (select)
          {
                case 0:
                  ...
  
          case 2:
  
              clear_bitmap(buffer);
              character.Draw(buffer);
  </code></pre>
  
  <p>This is where it fails and if I don't use the class function to Draw. and just input Draw_Sprite(example) it works.</p>