|
-
October 5th, 1999, 04:52 AM
#1
Pointer to Object
I got a Pointer-Var.:
Action *pAction=List->pAktion
I want to call a function looks like this:
int SendAction(Aktion oAktion){...}
How to convert the Pointer so I can call the function without changing it (the function).
Thank you *** * * * * * * * * * * * * * * * * *
-
October 5th, 1999, 05:16 AM
#2
Re: Pointer to Object
Hi,
Try this:
Action *pAction=List->pAktion;
int nResult= SendAction(*pAction);
Hope this helps,
Oleg.
-
October 5th, 1999, 07:14 AM
#3
Re: Pointer to Object
As a quick word of explanation, preceding a pointer with a '*' dereferences it.
i.e. If...
Action* pAction = List->pAktion;
then...
pAction ...is a pointer to an Action object, and...
*pAction ...is the object to which pAction is pointing.
Thus...
pAction->SomeFunction() ...and...
(*pAction).SomeFunction()
...are the same thing.
Hope this helps.
MikeM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|