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
Define External Storage Class - computer programming? When a variable is declared outside a function the storage is permanently assigned to it and its storage class is 'extern'

Question 1 Write a program in ‘C' to check whether a given number is even or odd Question 2 Explain while and do... while loop with an example Question 3 Write a program

Draw a flowchart for a program that allows the user to enter 20 names along with their ages and their Social Security Numbers in three parallel arrays. Programs shou

This task involves char arrays and pointer based string handling. Which we use to make a simple encryption program, using a Caesar Cipher, Write a program that: a. Asks

THIS PROGRAM IS TO DISPLAY A STOCK CONTAINING ITEM CODE,ITEM NAME,PRICE AND ANOTHER STOCK WITH CODE & QUANTITY AND DISPLAY COMPLETE INFORMATION #include #include #include

In rPeANUt implement the "char getchar()" and "void printstring(char *str)" functions. Using these functions implement the following: void main() {    while (1) {       ch

#an array that accept input and gives an output

C CODE FOR PEBBLE MERCHANTS PROBLEM


#questionAt a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets