HerbSchildt.com

 

Corrections for

The Art of C++

 

Errata #1. In Mini C++ in Chapter 9, the return statement is not always handled correctly. Fixes follow.

Page 339: The RETURN case should be as shown here.


case RETURN: // return from function call
  func_ret();

  // Add the following code. ****************
  breakfound = true;

  // Reset nested scope.
  local_var_stack.resize(nest_scope_stack.top());
  nest_scope_stack.pop();
  // End of addition. ***********************

  return;

 

Page 343: Add the indicated line to the call( ) function.

.
.
.
// Reset local_var_stack to its previous state.
local_var_stack.resize(func_call_stack.top());
func_call_stack.pop();

// Add this line. ***********************
breakfound = false;

 

 

  © 2008  HerbSchildt.com  All rights reserved worldwide. No duplication allowed without prior written permission.