Gamestudio Links
Zorro Links
Newest Posts
Zorro version 3.0 prerelease!
by Grant. 02/24/26 22:21
WFO Training with parallel cores Zorro64
by Martin_HH. 02/24/26 19:51
ZorroGPT
by TipmyPip. 02/23/26 21:52
Camera always moves upwards?
by clonman. 02/21/26 09:29
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/19/26 13:22
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
3 registered members (TipmyPip, clint000, Grant), 6,810 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
alx, ApprenticeInMuc, PatrickH90, USER0328, Sfrdragon
19199 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 | 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