![]() |
Blitz Support : |
From: William Gallafent (william_at_[hidden])
Date: 2005-06-15 10:00:03
On Wednesday 15 June 2005 15:26, Kirill Titievsky wrote:
> Array<int,1> * pA;
pA is an uninitialized pointer to an array.
> Array<int,1> A;
A is an instance of an array on the stack (default
constructed).
> pA = new Array<int,1>(10);
Construct an array on the heap, and make pA contain its
address.
> A = *pA;
So copy the array pointed to by pA in to A, by calling
operator= on A.
> The result is: &A != pA
Of course. &A is the address of the array you allocated on
the stack, and pA holds the address of the one which you
allocated on the heap using new.
Perhaps you're actually trying to do this:
// Construct array on the heap
Array<int,1>* pA = new Array<int,1> (10);
// Make a reference to that array
Array<int,1>& A = *pA;
HTH,
-- Bill