Error: Warning: Incompatible Implicit Declaration of Built-in Function ‘Memcpy’ [Enabled by Default]

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?

1 Answer

You likely forgot to include <string.h>.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Sarah Jenkins
Author

Sarah Jenkins

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.