delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/30/23:22:17

Sender: nate AT cartsys DOT com
Message-ID: <3612F437.BD59C541@cartsys.com>
Date: Wed, 30 Sep 1998 20:17:11 -0700
From: Nate Eldredge <nate AT cartsys DOT com>
X-Mailer: Mozilla 4.05 [en] (X11; I; Linux 2.0.35 i486)
MIME-Version: 1.0
To: "Miguel A Pérez E" <mpereze AT lasalle DOT edu DOT co>
CC: djgpp AT delorie DOT com
Subject: Re: help with size of trees, and big arrays..
References: <004101bdec94$27fdc7a0$0f1919c8 AT mpereze>

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019