Jump to content

View more

Image of the Day

WIP title screen for #DeathOfAPartisan #screenshotsaturday #gamedev https://t.co/qJNhfZCvd4
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

C++ new/delete

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 Aroidzap   Members   

784
Like
0Likes
Like

Posted 11 August 2012 - 05:03 PM

Simple, fast question.

is :
char *data=new char[256];
delete[] data;
char *data=new char[256];
delete[] data;
equal to :
char *data=new char[256];
char *data=new char[256];
delete[] data;

?

#2 SiCrane   Moderators   

11765
Like
5Likes
Like

Posted 11 August 2012 - 05:04 PM

*
POPULAR

No. The second won't delete the first allocation.

#3 Aroidzap   Members   

784
Like
0Likes
Like

Posted 11 August 2012 - 05:23 PM

thanks




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.