Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c

memcpy

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?

like image 545
user2073729 Avatar asked Feb 28 '13 19:02

user2073729


1 Answers

You likely forgot to include <string.h>.

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

like image 110
cnicutar Avatar answered Oct 17 '22 17:10

cnicutar