Mail Archives: djgpp/1998/09/30/23:22:17
Miguel A Pérez E wrote:
> I have an structure like this:
[snip]
> Later, the program sets Raiz to a quadtree, where each
> node/leaf of it is of
> type ArbCuat. How do I to determine the real size of the
> tree Raiz, in
> bytes? sizeof() operator gives me this values:
> sizeof(Raiz) = 4
> sizeof(*Raiz) = 40
> Are these correct?
> I counted the number of generated nodes/leaves and
> multiplied by 40 gave me
> 176KB, if this is likely right?
Sounds likely. The pointer is 4 bytes in size, and the struct itself
has about 10 members (didn't count carefully) each of which are 4 bytes,
so that makes sense. Note that `malloc' has some overhead of its own,
but you probably don't need to worry about that.
Why do you need to know how large it is?
>
> //2:
This question is a bit difficult to explain; you might want to ask on
comp.lang.c, where this is more on-topic.
--
Nate Eldredge
nate AT cartsys DOT com
- Raw text -