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() {
                for(int i = 0; i < 128; i++) Control::g_Keys[i] = false;
        }
        
        bool getKey(int key) {
                return Control::g_Keys[key];
        }
        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. 



--- On Mon, 4/6/09, Tamas Marki <[email protected]> wrote:

> From: Tamas Marki <[email protected]>
> Subject: Re: [c-prog] noob question: implementation in header
> To: [email protected]
> Date: Monday, April 6, 2009, 7:24 AM
> On Mon, Apr 6, 2009 at 1:18 PM, Jos Timanta Tarigan
> <[email protected]> wrote:
> >
> When you are defining a static member in a class, you need
> to define
> the 'storage space'. Let me demonstrate with a
> simple example:
> 



      

Reply via email to