user2073729
user2073729

Reputation: 1171

error: warning: incompatible implicit declaration of built-in function ‘memcpy’ [enabled by default]

I get this error.

error: warning: incompatible implicit declaration of built-in function ‘memcpy’ [enabled by default]

This is the code:

int arr[ 12] = {1,0,0,0,0,0,0,0,0,0,9370, 0};
void *a = &arr;
memcpy(machine->mem, a,12*4);

What I am doing wrong?

Upvotes: 55

Views: 68481

Answers (1)

cnicutar
cnicutar

Reputation: 182619

You likely forgot to include <string.h>.

Add #include <string.h> to the top of your file.

Upvotes: 114

Related Questions