79107538

Date: 2024-10-20 16:40:08
Score: 2
Natty:
Report link

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.

Reasons:
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Akino