it's just shorter the other way.Code:if(rhInt.value == 0) { // the right hand side points to nothing, so that we are equal later we should point // to nothing therefore we set the pointer we are going to be using to nothing/null new_int = 0; } else { // The right hand side points to something, we want to point to a different something // that is a copy of the other something therefor we set new_int to point to the result // of calling new. new_int = new // A new something but a new what? int // the type of the new something, we need to call a constructor ( // what constructor? * // we are dereferencing somthing this has type int. thus a // construtor that takes a single value of type int, // int's copy ctor int::int(const int &other); (rhInt.value) // what we are dereferencing, this has type // pointer to int ); }
On edit: and Hunters version will actually work.