The memset
function sets each byte of the memory to the second argument (after the second argument is truncated). As enumerations are (normally) the size of int
you will get the wrong result. The only time it will work is for an enumeration value of zero, as it will then set all bytes to zero.
If you use e.g. READY_TO_CALCULATE
you will set each byte to 1
, which will create int
values of 0x01010101
instead of 0x00000001
.