I was looking at this old forum thread:
and was a bit confused as to what size_t (size_t serialize) is - is it a standard typedef in C (as I have seen it mentioned elsewhere here, or a placeholder for me to place my own type in?
just found it - its a replacement for int in string and memory copy functions
Just trying to understand this code, would someone be able to clarify some lines I don't understand please..
defining a struct of type dumb with name by - what does the sizeof member do, dynamically size the array?
struct dumb by[sizeof member] =
I'm a bit confused as to what the function of i is here - I can see that the memcpy transfers the contents of each member to consecutive array indexes
memcpy(&dst[i], &object->broiled, sizeof object->broiled);
i += sizeof object->broiled;
whats the purpose of size here, and why is it decremented?
void showbytes(const void *object, size_t size)
const unsigned char *byte;
for ( byte = object; size--; ++byte )