August 2001
Beginner
482 pages
10h 52m
English
| Q1: | Why should I declare an object as const if it limits what I can do with it? |
| A1: | As a programmer, you want to enlist the compiler in helping you find bugs. One serious bug that is difficult to find is a function that changes an object in ways that aren't obvious to the calling function. Declaring an object const prevents such changes. |
| Q2: | Why should I bother to declare anything on the heap? |
| A2: | Objects on the heap persist after the return of a function. In addition, objects declared on the heap can be used to create complex data structures as explored in Hour 19, “Linked Lists.” |
Read now
Unlock full access