View Single Post
Old 24 February 2021, 14:56   #39
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,368
Yeah, you need the * to make it a pointer. Otherwise it's a variable of type module, which contains lots of sub-fields and can't simply hold an integer like 0. The pointer points to a structure, but is in fact just a longword representing the memory location of that structure, meaning you can assign a number to it. This changes where the code thinks that structure is, so assigning 0 would make it think it's at address 0, and is why checking for null pointers is important. It would likely be an instant hard crash to write values to such a struct.

I'll have to sit down and have a play with that code when I have the time, see if I can figure out what needs to be done.
Daedalus is offline  
 
Page generated in 0.04249 seconds with 11 queries