July 2000
Intermediate to advanced
1280 pages
34h 55m
English
On several occasions, I told you that the object initialization and object assignment are different things in C++. When you are dealing with built-in data types, this distinction is often academic. Consider, for example, the following segment of the client code.
int v = 5; int u = v; // variable u is initialized
Compare this with the following segment of code.
int v = 5; int u; u = v; // variable u is assigned
In the first example, variable u is initialized at definition. In the second example, variable u is assigned after definition. For built-in variables, the end result is the same. When these computational objects are objects of programmer-defined types that handle their own memory, the difference ...
Read now
Unlock full access