S
Stefan =?UTF-8?B?TsOkd2U=?=
Jason said:Hi.
I have a structure that was used in a previous iteration of a loop, and I
want to clear out all the structures values that the previous iteration
assigned without assigning every variable to be 0.
I've thought of a few ways to do this, but they are all roundabout...
Does anyone know of a better way to do this?
Heres a sample idea that I came up with.
void clear_the_structure() // no parameters because structure is extern
{
for (i=0; i < sizeof(mystructure); i++) // for each byte in
structure's memory
{
((unsigned char)mystructure) = 0; // set this byte to null
}
}
Please, don't tell us more about 'mystructure'...
Is it a POD ?
Stefan
--