programminga general overview is uninitialized at this point in ++no such check is performed to verify that is assigned value prior to being used (howeverseveral vendors make products that do additional checksincluding this onethe use of uninitialized pointers typically crashes programsbecause they result in access of memory locations that do not exist in generalit is good idea to provide an initial valueeither by combining lines and or by initializing to the nullptr pointer dynamic object creation line illustrates how objects can be created dynamically in +new returns pointer to the newly created object in +there are several ways to create an object using its zero-parameter constructor the following would be legalm new intcell) new intcell} new intcell/ok / ++ /preferred in this text we generally use the last form because of the problem illustrated by obj in section garbage collection and delete in some languageswhen an object is no longer referencedit is subject to automatic garbage collectionthe programmer does not have to worry about it +does not have garbage collection when an object that is allocated by new is no longer referencedthe delete operation must be applied to the object (through pointerotherwisethe memory that it consumes is lost (until the program terminatesthis is known as memory leak memory leaks areunfortunatelycommon occurrences in many +programs fortunatelymany sources of memory leaks can be automatically removed with care one important rule is to not use new when an automatic variable can be used instead in the original programthe intcell is not allocated by new but instead is allocated as local variable in that casethe memory for the intcell is automatically reclaimed when the function in which it is declared returns the delete operator is illustrated at line of figure assignment and comparison of pointers assignment and comparison of pointer variables in +is based on the value of the pointermeaning the memory address that it stores thus two pointer variables are equal if they point at the same object if they point at different objectsthe pointer variables are not equaleven if the objects being pointed at are themselves equal if lhs and rhs are pointer variables (of compatible types)then lhs=rhs makes lhs point at the same object that rhs points at accessing members of an object through pointer if pointer variable points at class typethen (visiblemember of the object being pointed at can be accessed via the -operator this is illustrated at lines and of figure throughout this textwe use lhs and rhs to signify left-hand side and right-hand side of binary operator