memcpy — copying from memory to memory.

Description:

u8 memcpy(u8 *addr_1, u8 *addr_2, u8 size);

Copies the values of addr_2 array, in the number of size, into addr_1 array.


List of parameters:

addr_1

Destination address of copying (use & for connecting the address).

addr_2

Source address of copying (use & for connecting the address).

size

Number of bytes required to copy.


Example:

         <item addr="524:248" name="Test for memcpy function" type="script">

V-ID/V-ADDR {
	if(opt0())
	{
		u8 mas1[5] = {1, 2, 3, 4, 5};
		u8 mas2[5];
		memcpy(&mas2, &mas1, 5);
		u8 strForMess[70];
		sprintf(strForMess, "%cArray mas2 = {%d, %d, %d, %d, %d}", 1, mas2[0], mas2[1], mas2[2], mas2[3], mas2[4]);
		setStatus(@exciterId():32, &strForMess);
	}
}

</item>
	
        

The result of performing the example in the interface:

Array mas2 = {1, 2, 3, 4, 5}