Gamestudio Links
Zorro Links
Newest Posts
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, VoroneTZ, 1 invisible), 1,512 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
removing a struct from memory ( free() ) #315957
03/20/10 13:32
03/20/10 13:32
Joined: Jan 2002
Posts: 300
Usa
Rich Offline OP
Senior Member
Rich  Offline OP
Senior Member

Joined: Jan 2002
Posts: 300
Usa
Hello,

I just have a quick question. I have a pointer to a struct stored in an entity skill. Before I remove the entity, I have this piece of code:

free( &my.skill[99] );

is this the proper syntax to free the memory that was used by the struct? It seems to work with no errors, I'm just making sure.
Thanks.

Re: removing a struct from memory ( free() ) [Re: Rich] #315976
03/20/10 14:47
03/20/10 14:47
Joined: Dec 2008
Posts: 271
Saturnus Offline
Member
Saturnus  Offline
Member

Joined: Dec 2008
Posts: 271
"I have a pointer to a struct stored in an entity skill."

This means that my.skill[99] == pointerToStruct. The address operator is unnecessary here, as you already have the address stored in the skill. Thus it should rather read: free(my.skill[99]).

Re: removing a struct from memory ( free() ) [Re: Saturnus] #315998
03/20/10 17:11
03/20/10 17:11
Joined: Jan 2002
Posts: 300
Usa
Rich Offline OP
Senior Member
Rich  Offline OP
Senior Member

Joined: Jan 2002
Posts: 300
Usa
Ok, Thanks a lot laugh . I'll need to do some reading up on pointers, its been a while and I never quite got the full hang of them.


A8 com / A7 free

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