Is there a way to :
memcpy(m, k, sizeof(m))
where m[6] and k is much larger but you want to copy just a subset?
ie
something like
memcpy(m, k[3], sizeof(m)) where it starts at element k[3]
Is there a way to :
memcpy(m, k, sizeof(m))
where m[6] and k is much larger but you want to copy just a subset?
ie
something like
memcpy(m, k[3], sizeof(m)) where it starts at element k[3]
Well
memcpy(m, k, sizeof(m))
is
memcpy(m, &k[0], sizeof(m))
So
memcpy(m, &k[3], sizeof(m))
is entirely reasonable.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Thanks