Hello,
I have a big struct which I want to set to 0 however I am not able to use the safememset
on that struct, I can only use it with chars. Is there a way to use safememset on a struct?
safememset
You can use a reinterpret cast to interpret the struct as an array of chars and then use that as an argument to safememset(). For example:
Code: Select all
struct foo s;
safememset((s, char[]), 0, sizeof(s));
Thanks Richard, that was exactly what I was looking for.