comp.lang.ada
 help / color / mirror / Atom feed
From: mheaney@ni.net (Matthew Heaney)
Subject: Re: C's static variable
Date: 1997/09/05
Date: 1997-09-05T00:00:00+00:00	[thread overview]
Message-ID: <mheaney-ya023680000509972131160001@news.ni.net> (raw)
In-Reply-To: 34109F10.52E2@communique.net


In article <34109F10.52E2@communique.net>, RL <rladner@communique.net> wrote:

>Does anyone know how in Ada to produce the equivalent of a static
>variable in C?

Funny, this is probably the most frequently asked question about Ada.  

The answer is to declare the variable in a static scope, ie in a package
spec or body:

package P is

   A_Static_Variable : Integer;

end;

P is a library level declaration of a package.  It lives as long as the
application does, so any variables there are equivalent to C static
variables.

Check out the Ada FAQ at the Ada home page:

<http://www.adahome.com>

--------------------------------------------------------------------
Matthew Heaney
Software Development Consultant
<mailto:matthew_heaney@acm.org>
(818) 985-1271




  reply	other threads:[~1997-09-05  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-09-05  0:00 C's static variable RL
1997-09-05  0:00 ` Matthew Heaney [this message]
1997-09-07  0:00 ` Tom Moran
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox