Re: [gtk-list] Re: Need help in GTK-project



Derek Simkowiak wrote:
>
> > Can't I make the portstatus variabele local in the main() program and
> > use some kind of setter functions to set its value, without the use of
> > pointers ?
> 
>         That's what he was referring to: using "setter functions", as you
> call them.
> 
>         I admit that I haven't looked at your program, but it's almost
> always a bad idea to use global variables.  Instead, you use functions
> (that you document!) to set or change the variables.  Those functions are
> called an "interface", or API (Application Programming Interface).

I'm still thinking of how the function that should set the portstatus
variabele should look like... I think, if i make portstatus local to
main, i should have to use functions that take a pointer as their
argument, isn't it ?  If I don't use pointers, then the portstatus
variabele will be used in the function that needs it as an argument, but
after leaving the function, the portstatus variabele won't have
changed.  So what I'm trying to figure out if there's another way to set
the portstatus then declaring portstatus global or using functions that
take pointers as their argument...

Greetzzz
MC303

PS: find my program at http://hello.to/MC303 -> 'Stepper motor'
-- 
Bart Vandewoestyne		http://hello.to/MC303		
Hugo Verrieststraat 48		Bart.Vandewoestyne@skynet.be
8550 ZWEVEGEM			ICQ# 21275340
BELGIUM - EUROPE		nick: MC303
Phone: +32(0)56/75.48.11
-------------------------------------------------------------------
If carpenters made buildings the way programmers make programs, the 
first woodpecker to come along would destroy all of civilization.
				- Weinberg's Second Law -



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]