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:BinaryHeap.h ------------ #ifndef BINARY_HEAP_H_ #define BINARY_HEAP_H_ #include "dsexceptions.h" #include "vector.h" // BinaryHeap class // CONSTRUCTION: wi

Programming Assignment #3: Vehicle Track Performance Tests Purpose: The purpose of this programming assignment is to give the student experience in using functions, arrays, and str

THIS PROGRAM IS TO MULTIPLY THE TWO COMPLEX NO.S GIVEN BY THE USER #include #include #include struct complex     {     int real;     int imag;     }; void main()  {  clrs

how i can open a file

store the name of the political parties and the corresponding votes in two lists of equal length. access the lists is provided by two methods, each of which creates an interator th

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

For the circuit shown in Figure, verify the p.d. across resistor R3. If the total resistance of the circuit is 100Ω, verify the current flowing by resistor R1. Find also the

Shell sort - C Program: Write a program to define shell sort. void main() {                  //program for sorting by select sort int a[20],i,k,j,n;   clrscr();

Project Description: I am seeking a developer who can start an app from scratch and get it delivered to me as soon as possible. It is a little android based app. A background on

recsection method source code for searching position