Visual studio 19 reads char as wide (unicode)

84 views Asked by At

My issue is that visual studio is reading char as as a wide char.

char newChar ;
ReadProcessMemory(handle, (LPCVOID)(baseAddr), &newChar, 1, NULL);
std::cout << "Read char: "<<newChar << std::endl;

Has the output of

Read char: ╠ 

The output is unicode, but I had it declared as char, which should just be a byte of data. This code works in visual studio code, but not in visual studio 19.

1

There are 1 answers

1
Max K On

Sorry I was mistaken. It has nothing to do with wchar or unicode. The ReadProcessMemory function failed. Not sure why, I have requireAdministrator permission but that is the issue