On Mon, Apr 6, 2009 at 4:46 PM, Jos Timanta Tarigan
<[email protected]> wrote:

> well actually i dont even use a static anymore. this is the whole class:
>
> #ifndef CONTROL_H
> #define CONTROL_H
>
> #include "includes.h"
>
> class Control {
> public:
>
>        Control() {
>        }
>
>        void Control::init() {

should just be init()

>                for(int i = 0; i < 128; i++) Control::g_Keys[i] = false;

should just be g_Keys[i] (Control::g_Keys is invalid in this scope)

>        }
>
>        bool getKey(int key) {
>                return Control::g_Keys[key];

Same here, Control:: is not necessary
>        }
>        void setKey(int key, bool val) {
>                Control::g_Keys[key] = val;
>        }
> private:
>        bool g_Keys[128];
> };
>
> #endif
>
> it seems very simple but i got an error that the method init() is not part of 
> the class.

-- Brett
------------------------------------------------------------
"In the rhythm of music a secret is hidden;
   If I were to divulge it, it would overturn the world."
              -- Jelaleddin Rumi

Reply via email to