First of all even a simple program like that will have standard libraries mapped into it&#x27;s address space.  Your program is reading from a region of the processes address space that has the binary code for the memcpy() function.<p>On linux you can dump a processes address space mapping from file &quot;&#x2F;proc&#x2F;&lt;pid&gt;&#x2F;maps&quot;.
Or to see an example just run: cat &#x2F;proc&#x2F;self&#x2F;maps
That cat command will dump the address space mapping for that instance of the cat command.  If you run it multiple times it will show different address ranges because of a security feature (ASLR, address space layout randomization).<p>Also you shouldn&#x27;t use fprintf or printf to print 1 char.  printf will try to look for format characters in the &quot;string&quot; you are passing it.  It would be better to use fputc(*p, stdout), then you don&#x27;t even need to call memcpy() or the &quot;onechar&quot; array.<p>If you set &quot;p&quot; to a block of allocated memory, then your program should segfault shortly after reading past the end of the memory.  How many bytes you can read past the end of the allocated block of memory depends on how the memory allocator manages pools of memory and it&#x27;s own bookkeeping information is stored.