Re: Exception handling?
JoeC wrote:
How do I write a try throw command to see if this array is good?
Please define what it means for an array to be "good".
This is what I have so far:
void bitmap::changeBit(int ac, int dn, BYTE col){
BYTE up = 16-dn;
BYTE num = (up*acc)+ac;
if((num < acc*dwn) || (num > 0)){
if(bits == NULL){MessageBox(NULL, "HELP", "Info", MB_OK);}else{
try{bits[num] = col;}
If your 'bits' is an invalid memory address (like a pointer that has
been deleted, or an uninitialized pointer), you're not going to get a
standard exception. The Standard only says that the behavior is
undefined. You need to consult with the documentation for your compiler
and/or platform, which might shed some light on what happens. For
example, if you want to catch Windows exceptions (I infer you're on
Windows from 'BYTE' and 'MessageBox'), see "Structural Exception
Handling" in the Help (press F1, go "Search", type SEH, press Enter).
catch(Exception e){MessageBox(NULL, e.message(), "Info", MB_OK);}
}
}
}
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask