io6Library icon indicating copy to clipboard operation
io6Library copied to clipboard

memset/memcpy

Open SY6502 opened this issue 3 years ago • 1 comments

Is there reason for not using memset and memcpy instead of zeroing/copying of 16 elements of array? Like this:

DHCP_allocated_ip[0] = 0; DHCP_allocated_ip[1] = 0; DHCP_allocated_ip[2] = 0; DHCP_allocated_ip[3] = 0; DHCP_allocated_ip[4] = 0; DHCP_allocated_ip[5] = 0; DHCP_allocated_ip[6] = 0; DHCP_allocated_ip[7] = 0; DHCP_allocated_ip[8] = 0; DHCP_allocated_ip[9] = 0; DHCP_allocated_ip[10] = 0; DHCP_allocated_ip[11] = 0; DHCP_allocated_ip[12] = 0; DHCP_allocated_ip[13] = 0; DHCP_allocated_ip[14] = 0; DHCP_allocated_ip[15] = 0;

SY6502 avatar Jan 11 '23 13:01 SY6502

Thank you for your attention. You can use memset() or memcpy(). It means just 16 bytes.

taylor-an avatar Jan 13 '23 04:01 taylor-an