POV-Ray : Newsgroups : povray.off-topic : Adventures with C++ : Re: Adventures with C++ Server Time
29 Jul 2024 00:31:51 EDT (-0400)
  Re: Adventures with C++  
From: Orchid Win7 v1
Date: 31 May 2013 16:03:43
Message: <51a9021f$1@news.povray.org>
On 30/05/2013 10:46 PM, Francois Labreque wrote:

>>> A raw pointer is a basic type and thus will likewise not be implicitly
>>> initialized.
>>
>> So it points to random memory?
>
> Yes. C++ still allows you to shout yourself in the foot.

Oh, I wasn't disputing that. Just checking.

Today I discovered that some of the code I copy-pasted actually had some 
memory allocation in it, and I hadn't explicitly deallocated it again.

To be clear... I only need to do explicit deallocation if I've done 
explicit allocation in the first place, right?

   unsigned char foo[512];

vs

   unsigned char * foo = new[512];


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.