Can i employ realloc() on pointers allocated through new?, C/C++ Programming

A: No.      

While realloc() need to copy the allocation, this uses a bitwise copy operation, that will tear several C++ objects to shreds. C++ objects must be allowed to copy themselves. They employ their own copy constructor or assignment operator.

Besides of all, the heap that new uses might not be the similar as the heap that malloc() and realloc() use!

 

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







Related Discussions:- Can i employ realloc() on pointers allocated through new?, Assignment Help, Ask Question on Can i employ realloc() on pointers allocated through new?, Get Answer, Expert's Help, Can i employ realloc() on pointers allocated through new? Discussions

Write discussion on Can i employ realloc() on pointers allocated through new?
Your posts are moderated
Related Questions
a palindrome is a string that reads the same from bhote the ends

A: In C++, the definition of NULL is 0, thus there is only an aesthetic difference. I prefer to ignore macros, so I employ 0. Another difficulty with NULL is that people sometimes

Write a Program to illustrate the Call by Reference? Here is an illustration: #include . int compute_sum(int *n); int main( void) { int n=3, sum; printf("%d\n",n); /


Write a program that takes 3 small letters as input and sort them according to their ASCII value.

This is a test program that tests the Student and ITECH7603Class classes.     In this assignment you are provided with three input text files associated with this program:

real time application of b tree


The question description: You are required to make a C++ program to conduct timber component (beam and column) structural design according to EC5 (all the relevant design codes

Explain about the Expressions in c Language? An expression is the combination of constants, variables and operators arranged as per the syntax of the language. Some of the illu