[Freeciv-Dev] Re: Please vote!
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Thu, Nov 29, 2001 at 02:25:50PM +0100, Raimar Falke wrote:
> On Thu, Nov 29, 2001 at 02:06:31PM +0100, Reinier Post wrote:
> > B. There's a difference in meaning for 'static' variables:
> >
> > | #include <stdio.h>
> > |
> > | static int x()
> > | {
> > | static int the_x = 1;
> > | return ++the_x;
> > | }
> > |
> > | int main(int argc, char *argv[])
> > | {
> > | printf("%d\n", x());
> > | printf("%d\n", x());
> > | printf("%d\n", x());
> > | }
> >
> > prints
> >
> > 2
> > 3
> > 4
> >
> > (It doesn't without the 'static'.)
> > It seems clearer to restrict the syntax to static var initializations only.
>
> You mean non-static?
No, I mean: the syntax
int the_x = 1;
is best avoided.
--
Reinier
- [Freeciv-Dev] Re: Coding Guideline Updated RFC, (continued)
- [Freeciv-Dev] Re: Coding Guideline Updated RFC, Mike Kaufman, 2001/11/27
- [Freeciv-Dev] Please vote!, Gregory Berkolaiko, 2001/11/28
- [Freeciv-Dev] Re: Please vote!, Petrus Viljoen, 2001/11/28
- [Freeciv-Dev] Re: Please vote!, Stepan Roh, 2001/11/28
- [Freeciv-Dev] Re: Please vote!, vze2zq63, 2001/11/28
- [Freeciv-Dev] Re: Please vote!, Reinier Post, 2001/11/29
- [Freeciv-Dev] Re: Please vote!, Raimar Falke, 2001/11/29
- [Freeciv-Dev] Re: Please vote!,
Reinier Post <=
- [Freeciv-Dev] Re: Please vote!, Petr Baudis, 2001/11/29
- [Freeciv-Dev] Re: Please vote!, Reinier Post, 2001/11/29
- [Freeciv-Dev] Re: Please vote!, Gregor Zeitlinger, 2001/11/30
- [Freeciv-Dev] Re: Please vote!, Vasco Alexandre Da Silva Costa, 2001/11/29
- [Freeciv-Dev] Re: Please vote!, Ross W. Wetmore, 2001/11/30
- [Freeciv-Dev] Coding Guideline --- more variants, Gregory Berkolaiko, 2001/11/28
- [Freeciv-Dev] Re: Coding Guideline --- more variants, Raimar Falke, 2001/11/28
- [Freeciv-Dev] Re: Coding Guideline --- more variants, Raimar Falke, 2001/11/28
- [Freeciv-Dev] Re: Coding Guideline --- more variants, Petr Baudis, 2001/11/28
- [Freeciv-Dev] Re: Coding Guideline --- more variants, Raahul Kumar, 2001/11/29
|
|