J
JoeC
I found a flaw in my logic I was using a BYTE type rather than an int
type but when I changed the type the program fails. I do ensure that
the number is allowed by the size of the array. num is the number I
will modify in the array. I works when it is a BYTE type it crashes
with an int type.
void bitmap::changeBit(int ac, int dn, BYTE col){
int up = 16-dn;
int num = (up*acc)+(current*16)+ac;
if((num < acc*dwn) || (num > 0)){
bits[num] = col;
}else{ MessageBox(NULL, "bang!", "Info", MB_OK);}
}
acc and dwn are the size of the array. I am using a flat array to
represent 2d object. I am simply trying to change the elements int he
array.
Why would I get an error from an int and not from a BYTE?
type but when I changed the type the program fails. I do ensure that
the number is allowed by the size of the array. num is the number I
will modify in the array. I works when it is a BYTE type it crashes
with an int type.
void bitmap::changeBit(int ac, int dn, BYTE col){
int up = 16-dn;
int num = (up*acc)+(current*16)+ac;
if((num < acc*dwn) || (num > 0)){
bits[num] = col;
}else{ MessageBox(NULL, "bang!", "Info", MB_OK);}
}
acc and dwn are the size of the array. I am using a flat array to
represent 2d object. I am simply trying to change the elements int he
array.
Why would I get an error from an int and not from a BYTE?