Re: Paasing global variables to functions
- From: "Emmanuel Delahaye" <emdel@xxxxxxxxxxxxxx>
- Date: Thu, 28 Jul 2005 22:52:49 +0200
Alipha wrote on 28/07/05 :
ankisharma@xxxxxxxxx wrote:At many places I have seen that programmers pass global variables to functions in c. I am not able to figure out why they do so. need some clues on this. somewhere i heard that this philosophy is from object orieted world but is it applicable for c?
for instance, the function is called multiple times with different arguments than that specific global variable. eg:
f(myglobal); f(mylocal); f(myglobal2);
Huh! Yes!
-- Emmanuel The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html The C-library: http://www.dinkumware.com/refxc.html
"It's specified. But anyone who writes code like that should be transmogrified into earthworms and fed to ducks." -- Chris Dollin CLC
.
- References:
- Paasing global variables to functions
- From: ankisharma
- Re: Paasing global variables to functions
- From: Alipha
- Paasing global variables to functions
- Prev by Date: Re: Paasing global variables to functions
- Next by Date: Re: Copying a struct to a larger struct?
- Previous by thread: Re: Paasing global variables to functions
- Next by thread: Re: Paasing global variables to functions
- Index(es):