This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: global vs static


Y Khan <ykhanportland@yahoo.com> writes:

> I want to access a variable in a function and whose
> value doesn't change when I re-enter the function. I
> will be using that variable in that function only. I
> have two options - global or static. Which one is
> better?

This question is not appropriate for gcc-help.  It would be
appropriate for a mailing list which discusses C language style
issues.

Both global and static will work.  Which is better depends upon other
issues, mostly unrelated to the actual code, such as the style
guidelines you are following.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]