Shared Flashcard Set

Details

Expections
n/a
19
Computer Science
Undergraduate 2
01/15/2009

Additional Computer Science Flashcards

 


 

Cards

Term
what is a special floating point value that cout uses to represents infinity?
Definition
Inf, inf, INF
Term
Where is the abort() prototype located?
Definition
cstdlib (or stdlib.h) header file
Term
if abort() is called where does it send a to, what does it do, and what does it return?
Definition
sends: standard error stream (same as the one used by cerr)
Does: terminates the program
Return: implementation-dependent value that indicates failure to the OS, or it's parent process
Term
What are file buffers?
Definition
Memory areas used to store material for transfers to and from files
Term
What does get(void) return?
Definition
usually returns ASCII code for the next input character, but returns EOF if it encounters the end-of-file
Term
What is a exception?
Definition
A response to an exceptional circumstance that comes up while a program is running
Term
What do expections provide?
Definition
a way to transfer control from one part of a program to another
Term
What are the three components on handling exceptions?
Definition
- Throwing an exception
- Catching an exception with a handler
- Using a try block
Term
What is a throw statement?
Definition
A jump.
It tells a program to jump to statements at another location
Term
What is the throw keyword followed by?
Definition
a value
such as a character string or an object, that indicates the nature of the exception
Term
Where is the exception handler?
Definition
Where a program catches an exception, at the place in the program where you want to handle the problem
Term
What does the catch keyword indicate?
Definition
the catching of an exception.
Handler begins with keyword, followed by a type declaration (in parentheses), follow by {} to show what acts to take
Term
What is the exception handler also called?
Definition
catch block
Term
What is a try block?
Definition
a block of code for which particular exceptions will be activated.
Term
What are try blocks followed by?
Definition
one or more catch blocks
try {...}
catch(whatever) {...}
Term
What does the continue statement do?
Definition
Causes the program to skip the rest of the while loop and jump to its beginning again
Term
What is an exception specification?
Definition
indicates which kinds of exceptions it throws by appending the exception specification (throw)
Exp:
double hmean(double a, double b) throw(bad_hmean);
Term
What does the following indicate about the its throw?

double multi_err(double z) throw(const char*, double);

Definition
Term
double simple(double z) throw();

how many exceptions does it throw?

Definition
None
Supporting users have an ad free experience!