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
The probabilistic Hough transform uses random sampling instead of an accumulator array. In this approach the number of random samples r, is not specified in the OpenCV call, but is

There are 3 acceptable answers: "Never," "Rarely "and" When the problem domain cannot be accurately modelled any other way."

In the Byteland country a string "s" is said to super ascii string if and only if count of each charecter in the string is equal to its ascci value in the byteland country ascii co

Explain the Declaration of Multi Dimensional Arrays? In the figure, the range in the first dimension is 3 and in the second dimension is 4. The shaded portion corresponds to th

if one won't explicitly call the destructor of a local; then how does he handle the above situation?

C Program to FIND VOWELS   void main() {           char str[50];           int ac=0, ec=0, ic=0, oc=0, uc=0;           int i,stln,vc,word=1;           clrscr

Write a function to calculate the exchange rate of pounds to dollars  Answer       Td = 2xTp   The parameter passed over is the number of pounds and returned the value in do

Given an integer n and a permutation of numbers 1, 2 ... , n-1, n write a program to print the permutation that lexicographically precedes the given input permutation. If the given

Write a function that takes in a radius and evenly covers the screen with circles of that radius. Don't attempt to draw any circles that are completely off the screen.