Implementation of my_memcpy (memory copy from source to destination based on size) uses a lot of pointer arithmetic, which is a very common method of implementation.
Issue: Based on certain standards, my code is not supposed to use pointer arithmetic, but can use arrays.
Is there any way we can implement that function without using any pointer arithmetic?
I want the below logic to be implemented without the use of pointers:
while (u32_length >= SIZE)
{
*u32p_dst = *u32p_src;
u32p_dst++;
u32p_src++;
u32_length -= SIZE;
}
....
....
what about the following,
unsigned i = 0;
while(u32_length >= SIZE){
u32p_dst[i] = u32p_src[i];
++ i;
u32_length -= SIZE;
}