www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/06/02:31:50

From: Paul Shirley <Paul AT chocolat DOT obvious DOT fake DOT foobar DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Freeing static vars
Date: Thu, 5 Feb 1998 21:50:36 +0000
Organization: wot? me?
Lines: 12
Message-ID: <elW94GAsQj20Ewph@foobar.co.uk>
References: <199802050138 DOT RAA05569 AT adit DOT ap DOT net>
<3 DOT 0 DOT 5 DOT 32 DOT 19980205125943 DOT 007b3180 AT math DOT amu DOT edu DOT pl>
NNTP-Posting-Host: chocolat.foobar.co.uk
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In article <3 DOT 0 DOT 5 DOT 32 DOT 19980205125943 DOT 007b3180 AT math DOT amu DOT edu DOT pl>, Maciej
Radziejewski <maciejr AT math DOT amu DOT edu DOT pl> writes
>Perhaps it is too obvious to write, but isn't this accomplished in C++
>by defining a local scope and declaring the variables inside it?
>The variables will be destroyed upon leaving the local scope.

1st: they are only static if you mark them 'static'
2nd: static variables are not destroyed on leaving a scope (thats the
meaning of static after all!), only the name is hidden.

---
Paul Shirley: my email address is 'obvious'ly anti-spammed

- Raw text -


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