M
Mattjack40
Thanks Peter.
Matt
static struct Foo foo_zero = { 0 };
struct Foo foo;
..
foo = foo_zero;
Matt
In page 37 the book says"
stuct like
stuc FOO foo
memset(&foo,0, sizeof foo);
is not guranteed to have the desired effect if the structure
definition of FOO contains floating point numbers or pointers.
The book recommands usigng {0} to do the job. (struct FOO foo={0})
My question is that we can initialize a stucture in the beginning
of the program using {0} but what about ,for example, middle of a
program?
static struct Foo foo_zero = { 0 };
struct Foo foo;
..
foo = foo_zero;