CSC161 2011S Imperative Problem Solving
[Skip to Body]
Primary:
[Front Door]
[Schedule]
[Piazzza]
-
[Academic Honesty]
[Instructions]
Current:
[Current Outline]
[Current EBoard]
-
[Current Assignment]
[Current Lab]
[Current Reading]
Groupings:
[Assignments]
[Documents]
[EBoards]
[Examples]
[Exams]
[Handouts]
[Labs]
[Outlines]
[Readings]
[Reference]
Related Courses:
[CSC195 2003S (Rebelsky)]
[CSC161 2009F (Coahran)]
[CSC161 2010S (Walker)]
[CSC161 2010F (Rebelsky)]
Misc:
[SamR]
[ISO]
[GNU Coding Standards]
assertBack to Interactive Testing. On to Macros.
This outline is also available in PDF.
Held: Wednesday, 9 March 2011
Summary:
We consider issues of program correctness and ways in which
C's assert macro can help.
Related Pages:
assert Macro.Notes:
Boy Sam, that answer was too brief.)
Overview:
assert.Because we focus on preconditions and postconditions in 151, you may not have found much new in the reading.
Still, it is useful to keep a number of things in mind.
One then has the question of how to deal with preconditions and postconditions.
What should you do if a precondition is not met?
Additional notes
assertassert statement to help you deal with many
of these issues.
assert (expression) checks if expression
fails. If so, assert prints an error message and terminates
the program.
assert helps us catch errors early in a program. (One
great thing about C is that many errors pass through, screw something else
up, and it's really hard to find out the first place that something went
wrong.)
Back to Interactive Testing. On to Macros.
[Skip to Body]
Primary:
[Front Door]
[Schedule]
[Piazzza]
-
[Academic Honesty]
[Instructions]
Current:
[Current Outline]
[Current EBoard]
-
[Current Assignment]
[Current Lab]
[Current Reading]
Groupings:
[Assignments]
[Documents]
[EBoards]
[Examples]
[Exams]
[Handouts]
[Labs]
[Outlines]
[Readings]
[Reference]
Related Courses:
[CSC195 2003S (Rebelsky)]
[CSC161 2009F (Coahran)]
[CSC161 2010S (Walker)]
[CSC161 2010F (Rebelsky)]
Misc:
[SamR]
[ISO]
[GNU Coding Standards]
Disclaimer:
I usually create these pages on the fly
, which means that I rarely
proofread them and they may contain bad grammar and incorrect details.
It also means that I tend to update them regularly (see the history for
more details). Feel free to contact me with any suggestions for changes.
This document was generated by
Siteweaver on Tue May 10 10:34:31 2011.
The source to the document was last modified on Wed Jan 5 12:52:14 2011.
This document may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CSC161/2011S/Outlines/outline.27.html.