Message-ID: <33DFC2DB.356A@lr.net> Date: Wed, 30 Jul 1997 18:40:27 -0400 From: Isaac Waldron Reply-To: waldroni AT lr DOT net Organization: The Computer Nerd MIME-Version: 1.0 To: djgpp AT delorie DOT com Subject: Accessing Variables Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk Does anyone know if it is possible to create a variable in a function, and then access it outside of that function. For instance, I have classes Ship and Shot, can I use code like this: Ship::Fire() { Shot gun(x + 20, y + 8); //constructor takes x and y for shot }; Ship::Update() { if (Shot::pFirst) { Shot::pFirst->Update() }; }; Basically, I need to know if a variable constructed in a function can be made to not be destructed at the end of that function, and have it visible globally? If not, does anyone know how to make a linked list of objects so I can have more than one object of any one type on screen at one time? thanks in advance, -- -Begin Signature- Isaac Waldron N1YZI http://www.geocities.com/SiliconValley/Lakes/5703/home.html -End Signature-