[LC++]declaring and using manipulating global variables

Dr Mark H Phillips mark at austrics.com.au
Fri May 16 09:55:46 UTC 2003


On Fri, 2003-05-16 at 10:46, Julien Patrick Claassen wrote:
> Hi!
>   This is slightly [OT], because I'm interested in something more c-specific.
>   I want to create a global variable and manipulate it in several functions,
> so that it is globally changed. I wanted to do it in a nice way(meaning no
> dirty temporary solution). At the moment I create a variable in main() and
> pass its address to the functions, which need to edit its value. But I'm not
> very happy with this.

What exactly are you unhappy about with your current solution?

Cheers,

Mark.

>   Thanks for any help.
>   Kindest regards
>          Julien
> 
> Julien Patrick Claassen
> jclaassen at gmx.de
> julien at c-lab.de
> http://www.geocities.com/jjs_home
> 
> SBS C-LAB
> Fuerstenallee 11
> 33102 Paderborn
> 
> Phone: (+49) 5251 60 6060
> Fax: (+49) 5251 60 6065
> 
> www.c-lab.de
> _______________________________________________
> This is the Linux C++ Programming List
> : http://lists.linux.org.au/listinfo/tuxcpprogramming List
-- 
Dr Mark H Phillips
Research Analyst (Mathematician)

AUSTRICS - smarter scheduling solutions - www.austrics.com

Level 2, 50 Pirie Street, Adelaide SA 5000, Australia
Phone +61 8 8226 9850
Fax   +61 8 8231 4821
Email mark at austrics.com.au




More information about the tuxCPProgramming mailing list