Mail Archives: djgpp/1997/07/30/18:37:56
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 <waldroni AT lr DOT net> N1YZI
http://www.geocities.com/SiliconValley/Lakes/5703/home.html
-End Signature-
- Raw text -