void *

M

Michael Sgier

Hi
how should I call that function? I don't understant the parameter. What
exactly is void * inRefcon doing?
Many thanks
Michael
 
M

Michael Sgier

thanks Paavo
so how can i dereference that? the code below does not work:
Many thanks again
Michael


if ( GetFDCallback == (int*)1 ) {
sometheing;
}
 
D

Default User

Michael said:
thanks Paavo
so how can i dereference that? the code below does not work:
Many thanks again
Michael


if ( GetFDCallback == (int*)1 ) {
sometheing;
}

1. Please include quotes to provide for your posts. See almost every
other message in the group.

2. What do you mean by, "doesn't work"?

3. Also, you didn't deference anything in the snippet.



Brian
 
M

mikethebike

Hi Brian

-------------------

dereferencing? might be the wrong word? Anyway GetFDCallback returns
FD. FD is defined as int. Actually I want to:
if FD == 1 do that
elseif FD == 2 do other
etc.
Could I simmply leave away: (void * inRefcon)? I don't see the point
why this has been done so.
Thanks
Michael
 
I

Ismo Salonen

mikethebike said:
Hi Brian

----------
---------

dereferencing? might be the wrong word? Anyway GetFDCallback returns
FD. FD is defined as int. Actually I want to:
if FD == 1 do that
elseif FD == 2 do other
etc.
Could I simmply leave away: (void * inRefcon)? I don't see the point
why this has been done so.
Thanks
Michael

The error message suggests that you are not calling the function (thus
just comparing the address).

if ( GetFDCallback() == (int*)1 ) {

Add the () there.

ismo
 
A

Alf P. Steinbach

* Ismo Salonen:
The error message suggests that you are not calling the function (thus
just comparing the address).

if ( GetFDCallback() == (int*)1 ) {

Add the () there.

According to Michael's original post the function signature is

int GetFDCallback( void* )

so the above would be very invalid code.

I think any advice here about how to "call" the function would probably mislead
Michael, since it seems that his idea of "calling" it is just a wild idea.

Mostly the problem boils down to Michael assuming that readers of his post are
telepathic. Well, Michael, we're not telephathic: offhand we have no clue as to
where you stumbled over this function or what it's about or whether its name is
indicative of something or just a name you cooked up, or whatever, and no-one is
going to spend time trying to find out. As suggested else-thread, RTFM.


Cheers & hth.,

- Alf
 
D

Default User

mikethebike said:
Hi Brian

----------
---------

dereferencing? might be the wrong word? Anyway GetFDCallback returns
FD. FD is defined as int. Actually I want to:
if FD == 1 do that
elseif FD == 2 do other
etc.
Could I simmply leave away: (void * inRefcon)? I don't see the point
why this has been done so.

I can't figure out what you want. Start over and lay out the
requirements for what you are trying to do, including a small usage
example. Don't bother with the code, as that's not what you need anyway.



Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top