Mail Archives: djgpp/2000/05/04/05:45:55

Date: Thu, 4 May 2000 14:09:19 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: "nimrod a. abing" <synflood AT eudoramail DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: gdb problem or just silly me - please help
In-Reply-To: <>
Message-ID: <Pine.SUN.3.91.1000504140549.18008A@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Thu, 4 May 2000, nimrod a. abing wrote:

> I think it's because the compiler seems to confuse
> between `char **string_array' and 
> `char *string_array[]'. The former is a pointer to 
> pointer to char types. The latter is an array of char
> pointers.

The compiler is not confused: these *are* two different things, as others 
have explained to you.  It was a bug in your code.

> If the compiler compiles this without issuing
> some sort of warning, then one would assume the code is
> correct when in fact they refer to two distinct types.

Welcome to C.  The C programming language traditionally assumes that the 
programmer knows what she is doing.  You should turn on all of the 
warning options ("-Wall -W" would be a good start) if you want better 
diagnostics, but even then I'm not sure the compiler would flag this
particular bug, because some valid programs use it (and know how not to 
crash ;-).

- Raw text -

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