Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, The_Judge, Grant), 898 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Function pointer in stucts #140062
07/07/07 23:39
07/07/07 23:39
Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
T
TWO Offline OP

Serious User
TWO  Offline OP

Serious User
T

Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
typedef struct
{
void LeftClick();
} AwakeGUI_WindowElement;

function odd();
{
}

AwakeGUI_WindowElement Element;

Element.LeftClick = odd;
Element.LeftClick(); // ERROR

?

Re: Function pointer in stucts [Re: TWO] #140063
07/09/07 11:21
07/09/07 11:21
Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
T
TWO Offline OP

Serious User
TWO  Offline OP

Serious User
T

Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
Waaaaaaaaaaaaah!

Re: Function pointer in stucts [Re: TWO] #140064
07/09/07 11:31
07/09/07 11:31
Joined: Jul 2000
Posts: 27,935
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,935
Frankfurt
This is no valid C code. In C you can store function pointers in struct elements, but you can't call a struct element.

Re: Function pointer in stucts [Re: jcl] #140065
07/09/07 12:44
07/09/07 12:44
Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
T
TWO Offline OP

Serious User
TWO  Offline OP

Serious User
T

Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
I know I can't treat a void like a function, I posted to get to know how I can archive something similar.

Re: Function pointer in stucts [Re: TWO] #140066
07/09/07 15:20
07/09/07 15:20
Joined: Jul 2000
Posts: 27,935
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,935
Frankfurt
Just as you did, only without the struct.

void LeftClick();
LeftClick = odd;
LeftClick();


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1