Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2002:
[Freeciv-Dev] Re: newbie C question
Home

[Freeciv-Dev] Re: newbie C question

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Piotr Sulecki <Piotr.Sulecki@xxxxxxxxxxxxx>
Cc: "Per I. Mathisen" <Per.Inge.Mathisen@xxxxxxxxxxx>, <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: newbie C question
From: Ben Webb <ben@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 5 Mar 2002 12:29:31 +0000 (GMT)

On Tue, 5 Mar 2002, Piotr Sulecki wrote:

> > No. No variables are initialised at all in C.
> 
> I seem to recall something about static and global variables being
> initialised with zeroes. But I may be wrong, or it may be
> implementation-specific

Sorry, I was referring to automatic variables. Globals are evil anyway. ;)

> (I'm 99% sure Borland/Turbo C/C++ for DOS works this way).

A quick test suggests that gcc does this too.

        Ben
-- 
ben@xxxxxxxxxxxxxxxxxxxxxx           http://bellatrix.pcl.ox.ac.uk/~ben/
"It is quite a three-pipe problem."
        - 'The Red-Headed League', Sir Arthur Conan Doyle



[Prev in Thread] Current Thread [Next in Thread]