The problem here is that by using a char * cout assumes that address refers to the beginning of a '\0' terminated string but since you took it from the address of a single char it will look for the '\0' beyond "valid" memory, if you wanna print a single char just use the 'char ch' variable, if you wanna print the address's pointer do as Tim Roberts did.