Programming Exception

In computer programming, a programming exception occurs when an error is discovered during the course of programming. The most commonly known one is a divide by zero error, meaning that a statement like
  C code ------- 
{
  A=0;  C = B/A; 
}
  end of code --- 
is encountered (usually by the compiler or OS). In the early days, the computer would usually crash, or return the user to the OS. With the advant of structured exception handling, a programmer has the ability to compartmentalize the error to a certain scope in his code. The mechanism for compartmentalizing the code is the try/catch block. Hence in a segment of C code
  C code --------- 
{
  try {   A=0;   C = B/A;  } catch (...) {   printf("A is zero!");  } 
}
  end of code --- 
one has the ability to structure the programming behavior and even supress certain types of errors without subverting the original compilers design intent through the use of C/UNIX signals. However, with structured programming handling, one has the ability to define new exceptions based on a user's defination of an exception. For example, the user can introduce an new exception which he defines.
  C code --------- 
{
  Exception DivideByZeroIntException;  try {   int iB, iC, iA=0;   if (0 == iA) throw DivideByZeroIntException;   iC = iB/iA;  } catch (DivideByZeroIntException) {   printf("A is zero!\n");  } catch (...) {   printf("something else is wrong\n");  } finally {   printf("A=%d", iA)  } 
}
end of code ---

 

<< PreviousWord BrowserNext >>
netarhat
haymarket, edinburgh
haymarket
pasilan linkkitorni
pelike
change state
heterogeneous network
steeles avenue
junxure
bathurst street
hinduism in czech republic
terrence holt
shawn wooley
vacilando
fernmeldeturm hoherodskopf
ruckers
newel kimball whitney
galactomannan
rob thompson
frank schoonover
edward washburn hopkins
cross river tram
mixtie
timothy j hickey
antonio lombardo
autolink
handsel
stevenson family
downcycling
gawilghur
list of star wars
torre entel
cheshire gritstone trail
moose (graffiti artist)
oj mayo
nuclear localization signal
de beauvoir town
ashtray
bega valley
heckler's veto
the hollywood palace
american electric power
chavn de huantar (military)
i love you but i've chosen darkness