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
Develop Pidgin for Windows Project Description: I want to build Pidgin (open source instant messenger) for Windows with D-Bus support enabled. I've effectively built both

#Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can

Write a C++ program doing the following: The program reads from the keyboard the numbers of rows and columns of a 2-D array of integers. Then, it allocates this array (let’s name i

A string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''a''-''z'') and the asci

Which constructor gets called while I create an array of Fred objects?

write aprogram in c++ to overload +,-,=,++ operator using unary and friend function in a single program

Member Functions of a Class A member function of the class is similar as an ordinary function. Its declaration in a class template must explain its return value as well as the

Explain Rules for constructing variable names? The Rules for constructing variable names : a) A variable name is any combination of alphabets, 0 to 9 digits and undersc

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

What are Arrays? Numerous applications require the processing of multiple data items that have identical characteristics. In such circumstances it is frequently convenient to p