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

Do I have to cast here ?



I have the following situation:

I have a function that i use for initializing the status of the parallel
port:

void mot_initialize_parallel_port(int *mot_parallel_port_status)

And in my main program I want to give this function a parameter that is
of type gint. Now is my question: do i have to cast this gint thingy to
a int or not?  I tried:

gint mot_portstatus=0;
...
mot_initialize_parallel_port( (int *)&mot_portstatus);


and i also tried:


gint mot_portstatus=0;
...
mot_initialize_parallel_port(&mot_portstatus);

and both methods seemed to work... 
What method is the 'best' one? (thinking of portability and stuff like
that...)

Tnx!

Greetzzz
MC303


-- 
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 we knew what it was we were doing, it would not
 be called research, would it?"
				-- Albert Einstein --




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