... *yPtr = 9;
which would assign
y in Fig. 8.3—in the preceding statement,
*yPtr is an alias for
y. The dereferenced pointer may also be used to receive an input value as in
cin >> *yPtr;
which places the input value in
Dereferencing an uninitialized pointer results in undefined behavior that could cause a fatal execution-time error. This could also lead to accidentally modifying important data, allowing the program to run to completion, possibly with incorrect results.