1 registered members (tomaslolo),
1,542
guests, and 12
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Function Vs. Void
[Re: alibaba]
#449455
03/21/15 00:38
03/21/15 00:38
|
Joined: Oct 2011
Posts: 1,082 Germany
Ch40zzC0d3r
Serious User
|
Serious User
Joined: Oct 2011
Posts: 1,082
Germany
|
void cant return anything aka 0xC3 in assembler Function is equivalent to var, meaning you can return a var aka 0xC2 in assembler. 0xC2 is followed by a WORD (2 bytes) with parameter count in bytes to clear the stack (if its stdcall, fastcall or thiscall)
Last edited by Ch40zzC0d3r; 03/21/15 00:41.
|
|
|
Re: Function Vs. Void
[Re: Ch40zzC0d3r]
#449456
03/21/15 00:54
03/21/15 00:54
|
Joined: Apr 2005
Posts: 1,988 Canadian, Eh
DLively
OP
Serious User
|
OP
Serious User
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
|
Hmm... So if I understand you correctly, a void can't have void(VECTOR* temp) but 'function()' can.
edit: Because if the function returns a parameter, it can be temp = function(temp); but temp = void(temp); is not allowed?
Last edited by DLively; 03/21/15 00:56.
|
|
|
Re: Function Vs. Void
[Re: DLively]
#449466
03/21/15 09:51
03/21/15 09:51
|
Joined: Nov 2007
Posts: 2,568 Germany, BW, Stuttgart
MasterQ32
Expert
|
Expert
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
|
function is just an alias for var. Both are defined with as fixed:
typedef fixed var;
typedef fixed function;
So you can actually do this:
function a, b;
a = 10;
b = 20;
printf("%f", a + b);
Regards
|
|
|
Re: Function Vs. Void
[Re: MasterQ32]
#449469
03/21/15 10:05
03/21/15 10:05
|
Joined: Apr 2005
Posts: 1,988 Canadian, Eh
DLively
OP
Serious User
|
OP
Serious User
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
|
MIND BLOWN Makes perfectly good sense in combination with the above answer.
Last edited by DLively; 03/21/15 10:11.
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|