Quote:

So basically what you're saying is, that I've allocated the number of the address of my "tmp" MAGNET pointer




Exactly, tmp is just a reference number, like a note with an adress to a house on it. You can have several seperate notes with the same adress on them, pointing to the same house (allocated space). That can however be dangerous, if you were to free the memory of the allocated space (i.e. remove the house), and still having notes with the adress to it (pointers), the program could crash if you were to try to use these pointers. So having several pointers doesnt mean you have several instances of that struct instance you created with malloc. It's still just one instance, but which you can have as many pointers to it as you want to. Usually you dont need more than one.

Quote:

so I can allocate the values of the struct to other places?




Im not quite sure if i understand this correctly but, yes, you can allocated the values of the struct to other places. I think you only use the term "allocated" when you store data dynamically (i.e. on the heap, i.e. with malloc). But remember that pointers and regular values are different.

Quote:

Does this mean I can use it like ent_create, in that I can create as many as I want (or at least as many as my PC's RAM will hold, which is a lot, )?




Yes, exactly. env_create probably works pretty much the same. It returnes an ENTITY pointer to a space it has allocated, and initialized its members within the struct.

Last edited by Kenchu; 02/02/08 11:32.