in reply to Re: Re: Help - I'm a C programmer
in thread Help - I'm a C programmer
There are times when you do need something similar to a global variable functionality; in languages where namespace collisions can be easily avoided, such as C++, Java, Perl, or the like, you should never define a global variable, instead creating one at an Object or Package scope. Unforunately, you can't do the same for C; the best you can do is create a special variable with a very descriptive name to act as a global, such that the chance for namespace collision is low. Even with something like errno, that ought to be stored away in some non-global area to prevent some third party code overwriting it unintentionally before you have a chance to use it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 4: Help - I'm a C programmer
by tilly (Archbishop) on Jun 18, 2001 at 19:29 UTC | |
|
Re: Re: Re: Re: Help - I'm a C programmer
by John M. Dlugosz (Monsignor) on Jun 18, 2001 at 05:14 UTC |