Does this delete all the pointers or does this just delete the first pointer p1?
delete p1,p2,p3,p4,p5;
It is equivalent to:
(((((delete p1),p2),p3),p4),p5);
That is, it deletes p1 and then the comma operator is applied to the result (of which there is none) and p2. The expressions p2 to p5 are simply evaluated and the results discarded.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With