buffer is defined as a char and when you pass buffer to std::cout it prints the char representation of the bytes stored in buffer. You try to fill buffer by calling ReadProcessMemory() on an arbitrary memory address, but it fails.
buffer is not initialized and because ReadProcessMemory fails it's printing the char representation of the un-initialized memory inside buffer.
Here is your code modified to call ReadProcessMemory on a variable in the current process, perhaps easier for learning purposes.
HANDLE hProcess = OpenProcess(PROCESS_VM_READ, 0, GetCurrentProcessId());
char buffer[20];
char* me = "Test";
ReadProcessMemory(hProcess, me, &buffer, sizeof(me)+1, 0);
std::cout << "Data read : " << buffer << std::endl;
system("pause");
return 0;
This would correctly output "Data read : Test" to the console.
If you assign nullptr to "char* me" you will get the same "╠╠╠╠╠╠╠╠" mumbo jumbo that you got previously as it will point at address 0x0 which is typically uninitialized.
Keep in mind if you're trying to read a string from another process you will want to reverse engineer the hard coded string size if it's not null terminated and only read the correct number of bytes.