Skip to Content
C++ for Lazy Programmers: Quick, Easy, and Fun C++ for Beginners
book

C++ for Lazy Programmers: Quick, Easy, and Fun C++ for Beginners

by Will Briggs
October 2019
Beginner
655 pages
12h 5m
English
Apress
Content preview from C++ for Lazy Programmers: Quick, Easy, and Fun C++ for Beginners
© Will Briggs 2019
W. BriggsC++ for Lazy Programmershttps://doi.org/10.1007/978-1-4842-5187-4_18

18. Exceptions, Move Constructors, Recursion, and O Notation

Will Briggs1 
(1)
Lynchburg, VA, USA
 

One needful thing – a better way of handling error conditions – and a few very-nice-to-haves: more efficient copying (“move” functions), functions that call themselves (recursion), and a way to figure how time-efficient your functions are.

Exceptions

How should a program handle runtime errors? Some options:
  • The ostrich algorithm. Simply hope the problem will never occur: your integers never exceed INT_MAX, your calls to strcpy never overrun the char array, and so on. We do it a lot, and it works! Shall we try it in software for a nuclear reactor? For verifying ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C++20 for Lazy Programmers: Quick, Easy, and Fun C++ for Beginners

C++20 for Lazy Programmers: Quick, Easy, and Fun C++ for Beginners

Will Briggs

Publisher Resources

ISBN: 9781484251874Purchase LinkPublisher Website