Re: Paasing global variables to functions



ankisharma@xxxxxxxxx wrote:

> Hi all
>
> 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.

Never underestimate the sheer overwhelming power of mindless stupidity.

> need
> some clues on this. somewhere i heard that this philosophy is from
> object orieted world but is it applicable for c?

Think global. Act local.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
mail: rjh at above domain
.



Relevant Pages

  • Re: extern for global variable: C Question
    ... I am not a fan of global variables at all. ... have hard ever had to resort to using a global variable. ... I declared an array as "extern" and then defined ... I have seen some programmers follow this approach. ...
    (microsoft.public.vc.language)
  • Re: Paasing global variables to functions
    ... >At many places I have seen that programmers pass global variables ... int main ... If the function foo() does not change the value of the ...
    (comp.lang.c)
  • Paasing global variables to functions
    ... At many places I have seen that programmers pass global variables ... somewhere i heard that this philosophy is from ... Prev by Date: ...
    (comp.lang.c)
  • Re: Regarding use of modules
    ... Thad Smith wrote: ... > When I have global variables (which most programmers try to minimize), ... > they are declared in a header file, which is included by any module ...
    (comp.lang.c)