delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/07/16:19:53

Date: Tue, 7 Mar 2000 10:23:58 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Gorka <gorkau AT geocities DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Problems with extern and sizeof
In-Reply-To: <200003062236.RAA14543@delorie.com>
Message-ID: <Pine.SUN.3.91.1000307102337.21628I-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: dj-admin AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Mon, 6 Mar 2000, Gorka wrote:

> kk2.c: Error: sizeof applied to an incomplete type.
> Can anybody tell me why?

Because, when it compiles kk2.c, the compiler doesn't know how large
dias[] is: the actual size is known inside mosqueo.e, but not in
kk2.c.

> And how to avoid it?

Make the size of dias[] a global variable computed at compile time,
and use it inside kk2.c as an extern.

- Raw text -


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