b1 points to the exact same data as does a1. This data is stack- allocated, and thus a2 points to an overwritten stack frame.
Thanks for explanation, I thought contetns of a1 are copied to the heap when assignment operator executed.
b1 points to the exact same data as does a1. This data is stack- allocated, and thus a2 points to an overwritten stack frame.
Thanks for explanation, I thought contetns of a1 are copied to the heap when assignment operator executed.