Difference between delete and delete[]?

Answer Posted / laxman

delete is only just to delete a variable which is created
by new operator. delete[] , it deletes the array where the
varaialbe points .

Is This Answer Correct ?    24 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is c++ and its features?

578


Write a program in C++ for Fibonacci series

664


can any one help to find a specific string between html tags which is changed to a sting.. weather.html looks (for location) is somewhere #include #include #include using namespace std; string find_field(string myPage,string); int main (void) { string page, line, location, temperature; ifstream inputFile("weather.xml"); while(getline(inputFile, line)) { page.append(line); line.erase(); } // Now page is a string that contains the whole xml page // Here you need to write something that finds and // extracts location and temperature from the XML // data in the string page and stores them in // the strings location and temperature respectively location=find_field(page,"location"); temperature=find_field(page,"temp_c"); cout << "Location: "<

1643


What is c++ and its uses?

625


What return value must conversion operators have in their declaration?

618






What is the full form nasa?

597


Explain abstraction.

620


what is COPY CONSTRUCTOR and what is it used for?

623


What is the advantage of c++ over c?

566


Explain mutable storage class specifier.

637


Why is standard template library used?

586


Is it possible for a member function to use delete this?

576


How do c++ struct differs from the c++ class?

594


What operators can you overload in c++?

596


Why is null pointer used?

686