How come if i memset a structure to zero like this
memset(structure, 0x00, sizeof(structure);
there's still some random data in the structure, verified by printing byte by byte,
but if i manually zero out the structure with a loop it's completely empty?
for(int i = 0; i < sizeof(structure); i++){
*(structure + i) = (uint8_t)0x00;
}
i'm getting data still set in the middle of the memory location. I'm guessing it's padding, but if the size is correct should it matter? how does that padding survive being set to 0x00?