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
P r i va t e Member Functions: A private member functions can be called by the members of the same class.  Consider the following example.   c l a ss sample


Program to define an array in c: Write a program to define an array and print the value of array. void main() { int a[10]={0,11,21,34,44,75,46,57,88,89},i,j,k; clr

hi i want wite a C++ program that get one logical phrase (included {x,y,z,w,1,0}) and simplify it! but i ''m confused! thanxs for anubody help me...

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

Explain some String Oriented Library Functions? To make simpler string processing we can use special string oriented library functions. Mainly the C compilers include library f

Ques.Implement a c/c++ program to find a shortest path between two nodes in a network?network should be taken as an adjacency matrix.

C Program for TOTAL  & AVERAGE IN THE ARRAY  #include stdio.h> #include conio.h> #include string.h> void main() {           int i=0,n[100],limit=0,a=0;

Structure of C++ Program: Chronological order of C++ program. 1.   Class declaration 2.   Main function program 3.   Member functions definitions 4.   Include heade

how much is it to fix a small data struct in a sorted list that pass itemtypes. all the code is written just logical errors