From 8420fa2a5184b1f9fb9cf6dbb1dc1f7cdb3bac9d Mon Sep 17 00:00:00 2001 From: lshprung Date: Wed, 27 Jan 2021 17:56:11 -0800 Subject: Fixed various small errors --- 01-26.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to '01-26.md') diff --git a/01-26.md b/01-26.md index da4652c..f7919d1 100644 --- a/01-26.md +++ b/01-26.md @@ -7,7 +7,7 @@ ### Introduction - The container classes' capacity is declared as a **constant** in the class definition (`bag::CAPACITY`) -- If we need bigger bages, then we can increase the constant and recompile the code +- If we need bigger bags, then we can increase the constant and recompile the code - What if a program needs one large bag and many small bags? - All the bags will be of the same size! @@ -123,7 +123,7 @@ d_ptr = new double[10]; ### Address Space Segmentation -![diagram](01-26_2.md) +![diagram](01-26_2.png) ### Stack Memory @@ -172,7 +172,7 @@ delete [] example_ptr; **Stack overflow** is the result of: - Allocating too many variables on the stack -- Making too many nested function valls +- Making too many nested function calls - Example: Where function A calls function B calls function C calls function D... - Stack overflow generally causes a program to crash @@ -191,7 +191,7 @@ int main(){ - The `new` operator usually indicates failure by throwing an exception called the `bad_alloc` exception - Normally, an exception causes an error message to be printed and the program to halt - Alternatively, a programmer can "catch" an exception and try to fix the problem - - **Exceptions** provide a way to reacto to exceptional circumstances (like runtime errors) in programs + - **Exceptions** provide a way to react to to exceptional circumstances (like runtime errors) in programs - When an exception is thrown, control is transferred to its **handler** ### Example 1 -- cgit