SOLVED static array in library

Hi all,

quick question (I hope) how do I declare a constant array of bytes in a library?
I placed this in my .h but... computer says no.

static const byte ModulesNum = 6;
static const byte Module[ModulesNum] = {0,1,2,3,4,5};

Hi Kevin

In your .cpp file, put this on a line by itself (not in the constructor nor in the methods):

const byte YourClassName::Module[ModulesNum] = {0, 1, 2, 3, 4, 5};

Regards

Ray

Thanks Ray,

I was wondering, aren't you supposed to declare all your variables in your .h file?

Is there a way to decide if it is public or private if you do it this way?

Yes, sorry I wasn't clear, I did not mean you should remove the declaration from .h.

Keep this in .h in your private or public member declarations:

static const byte ModulesNum = 6;
static const byte Module[ModulesNum];

Thanks!
That cleared things up.