Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Delete a new array?

Posted on 2004-10-31
Medium Priority
Last Modified: 2010-03-31
Hi Experts,

I used "new" to create array:
     double[][] myArray;
     int n;
     n = 3;
     myArray = new double[n][n];
Do I need to delete the array like that in C++? If I need, how to do that?

Thank you in advance.
Question by:daveask
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 16

Accepted Solution

krakatoa earned 320 total points
ID: 12456236
When the array object is no longer pointed to by any other object, then it will be garbage collected.
LVL 86

Expert Comment

ID: 12456238
krakatoa is correct

Author Comment

ID: 12456287
Thank you.

So, Java is better than C++ and VB in this aspect :-)
LVL 86

Expert Comment

ID: 12456293
>>So, Java is better than C++

It has virtually automatic memory-management - there are no deletes, destructors, etc. I can't remember what VB does
LVL 16

Expert Comment

ID: 12456320
Thanks for points and thanks CEHJ. ;)


Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question