A89: Matrix Errors


[Prev][Next][Index][Thread]

A89: Matrix Errors



I am having trouble using matrices.  If I declare a matrix and then try to
reference it the compiler gives me an error "Initializer value is not a
constant."  Heres the code:

int stats[6][8]=
{{1,20,0,5,3,4,6,0},
{2,25,5,8,5,5,7,50},
{3,29,7,10,8,7,9,150},
{4,32,11,14,10,10,10,300},
{5,37,14,15,14,11,13,500},
{6,40,15,20,17,15,15,750},};
int lvl=1;
int hp=stats[lvl][2],mhp=stats[lvl][2],mp=stats[lvl][3],mmp=stats[lvl][3];
                        /\
                        | |
the error points to here

and one more thing, this code is outside of all of my functions so it is
global, if that matters.  Can someone help me please?

CalenWakefield