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

CMemcpy

C Problem Overview


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?

C Solutions


Solution 1 - C

You likely forgot to include <string.h>.

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser2073729View Question on Stackoverflow
Solution 1 - CcnicutarView Answer on Stackoverflow