c++ declare nullptr and assign value code example Example: SET TO NULL pointer c++ *ptr=NULL; /*or*/ *ptr=0;