Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Question about static vs global variables

Author: Tom Kerrigan

Date: 15:53:53 10/26/01

Go up one level in this thread


On October 26, 2001 at 18:41:49, José Carlos wrote:

>On October 26, 2001 at 17:05:06, Tom Kerrigan wrote:
>
>>On October 26, 2001 at 16:56:19, Derek Mauro wrote:
>>
>>>As far as I can tell, static and global variables seem to be equally efficient,
>>>the only difference being that statics have a limited scope.  Am I right, or is
>>>one actually more efficient than the other?  Is there any advantage to passing
>>>around a static or a global?  I've always read that globals should be avoided.
>>>Is there any performance reason why?
>>>
>>>Thanks for your help in advance.
>>
>>I assume you mean static -> local. (?)
>
>  Nope. Static are local variables that last after the function has ended, and
>are still there when the function is called again.

Ooooh, right. Yeah, they're the same.
-Tom



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.