RE: [Dev-C++] Global to local variables
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: David M. <ci...@ya...> - 2002-04-21 20:38:52
|
static???
I was told that it will make sure the varible is initalized to 0
if it is uninitalized. As you can guess I ignored it because I called
it a waste of time
Anyway thanks
--- Ioannis Vranos <no...@ho...> wrote:
> Yes using the keyword static. E.g.
>
> void something(void)
> {
> static int x;
> /* ... */
> }
>
>
> x keeps its value between function calls and is created only once.
> This
> type of coding is not suitable for concurrent applications
> (multithreading).
>
>
> Ioannis
>
> * Ioannis Vranos
> * Programming pages: http://www.noicys.cjb.net
> * Alternative URL: http://run.to/noicys
>
>
> > -----Original Message-----
> > From: dev...@li...
> > [mailto:dev...@li...] On Behalf
> > Of David McKen
> > Sent: Saturday, April 20, 2002 11:41 PM
> > To: Dev-C Mailing List
> > Subject: [Dev-C++] Global to local variables
> >
> >
> > I have global varibles in my program that are used by one
> function
> > to keep track of it's state. Is there a way to have a local
> varible
> > to keep it's value between calls?
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Games - play chess, backgammon, pool and more
> > http://games.yahoo.com/
> >
> > _______________________________________________
> > Dev-cpp-users mailing list
> > Dev...@li...
> > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> >
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
__________________________________________________
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/
|