Playing with 'new' identifier and pointers.

BlitzMax Forums/BlitzMax Programming/Playing with 'new' identifier and pointers.

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

The code "VarPtr a" does not return the address of the object a, it returns the address of the reference to the new T object (which is what 'a' is, just a reference).

Therefore when you reassign the reference 'a' using the second 'a=New T', p1[0] will access the new object.