Douglas Rodrigues
Douglas Rodrigues

Reputation: 11

MoveMemory Byte array

I'm using this code:

#include <stdio.h>
#include <Windows.h>

#define address 0x00401054

int main(){
    byte values[4] = { 0x00, 0x00, 0x00, 0xB8 };
    MoveMemory((*(PVOID*)address), values[0], 4);
} 

But return this error

IntelliSense: argument of type "byte" is incompatible with parameter of type "const void *

what to do?

Upvotes: 0

Views: 366

Answers (1)

Greg Hewgill
Greg Hewgill

Reputation: 994281

Use &values[0] to take the address of the first element of your array.

Or, just use values by itself (instead of &values[0]), because the name of an array refers to the address of its first element.

Upvotes: 2

Related Questions