What have you done so far with regards of checksum?
bzero isn't as portable as memset, but yes, you can use bzero if you don't care about being portable. I would recommend memset, as I'm not aware of ANY OS that doesn't have a memset [it's probable one of the most common functions in <memory.h>, possibly after memcpy, so it's a quite common function]. I'm pretty sure that bzero, on systems that support it, is implemented like this:
Code:
void bzero(void *ptr, size_t size)
{
memset(ptr, 0, size);
}
If you really want to avoid writing the third argument, why not make a macro like this:
Code:
#define Zero(x) memset(x, 0, sizeof(x))
--
Mats