What if one forget the [] when deleteing array allocated , C/C++ Programming

What if one forget the [] when deleteing array allocated through new T[n]?

A: All life comes to a disastrous end.

It is the programmer's responsibility not the compiler's to get the connection among new T[n] and delete[] p correct. If you get it incorrect, neither a compile-time nor a run-time error message will be generated through the compiler. Heap corruption is a likely result. Or worse. Your program will die probably.

 

Posted Date: 3/19/2013 8:43:19 AM | Location : United States







Related Discussions:- What if one forget the [] when deleteing array allocated , Assignment Help, Ask Question on What if one forget the [] when deleteing array allocated , Get Answer, Expert's Help, What if one forget the [] when deleteing array allocated Discussions

Write discussion on What if one forget the [] when deleteing array allocated
Your posts are moderated
Related Questions
Structure of C++ Program: Chronological order of C++ program. 1.   Class declaration 2.   Main function program 3.   Member functions definitions 4.   Include heade

The program will ask the user to enter: '1' to List the cities(and their state abbrev)  from largest to smallest (by their population) with their population '2'  to List the

Write a C program to compute the factorial of  5 i.e. 1x2x3x4x5 etc Write a C program to calculate the output Y for a given value of X for the following formula.       Y=X 2

There is a pebble merchant. He sells the pebbles, that are used for shining the floor. His main duty is to take the length of the room’s sides. But he sometimes mistakes doing that

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

Write a program to calculate e^x using the formula: e^x = 1 + x/1! + x^2/2! + x^3/3! + ...... Allow the user to enter the integer number x, then do the calculation in a loop (for

Explain Register Variable Computers have internal registers, which are used to keep data temporarily, before any operation can be performed. Intermediate results of the calcula

Implement a Algorithm to verify if the link list is in Ascending order? A: template bool linklist::isAscending() const{ nodeptr ptr = head; while (ptr->_next)

Goals For this assignment you will write programs in C and LC-3 assembly code. Both programs will perform the identical recursive algorithm. The goals of this programming assignmen