[Cs3] using references with dynamic variables

Mikhail Nesterenko mikhail at cs.kent.edu
Wed Jun 10 14:17:01 EDT 2015


We discussed this today, so I did some research. Potentially, you can
do this:

	Int &refVar = * new int(55); // defining new reference variable
 	                             // and assigning it heap address

        delete &refVar; // deallocating heap address

However, this is considered uncommon enough practice as to be avoided
in your code.

thanks,
-- 
Mikhail


More information about the cs3 mailing list