Re: global vs static

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Y Khan <ykhanportland@xxxxxxxxx> 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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux