ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C++  >>  OOPS
 
 


 

 
 STL interview questions  STL Interview Questions
 OOPS interview questions  OOPS Interview Questions
 C++ General interview questions  C++ General Interview Questions
Question
Difference between realloc() and free?
 Question Submitted By :: Tribhuvan Sharma
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Difference between realloc() and free?
Answer
# 1
realloc():
memory when gets decreased, we can allocate it with the 
function called realloc().
free:
it is used to free the memory in the program.
 
Is This Answer Correct ?    0 Yes 0 No
Khadeer.k
 
  Re: Difference between realloc() and free?
Answer
# 2
free()is a macro used to deallocate memory.
when we need more memory realoc() reallocate memory 
according to given size, if there is no memory 4 
alocation ,it will free previous allocated memory & 
allocate new one using malloc().
ex: int *p = realloc(p,sizeof(p)*2);
 
Is This Answer Correct ?    1 Yes 1 No
Alka
 
 
 
  Re: Difference between realloc() and free?
Answer
# 3
realloc() can be use to reallocation of the memory if the 
memory already created is insufficient,
but free can be used to destroy the memory which was 
already created
 
Is This Answer Correct ?    2 Yes 0 No
Jayasrinivas.donavalli
 

 
 
 
Other OOPS Interview Questions
 
  Question Asked @ Answers
 
How is the using() pattern useful? What is IDisposable? How does it support deterministic finalization? IntraLogic1
You have one base class virtual function how will call that function from derived class?  4
what is the main difference between c and c++? Microsoft25
What is OOPS and How it is different from Procedural Programming ? HP10
how to find no of instances of an object in .NET? Infosys1
Name an advantage of array over linked list? IBM12
What is virtual class and friend class? Intel2
Difference between over loading and over ridding? CTS10
what is multi level inheritance give n example ? Ness-Technologies2
what is the use of mutable key word HCL2
How Do you Code Composition and Aggregation in C++ ? IBM1
how to swap to variables without using thrid variable in java?  3
what is the difference between <stdio.h>and "stdio.h"?  2
what is the function of 'this' operator ?  4
What is the difference between XML Web Services using ASMX and .NET Remoting using SOAP?  1
What is extreme programming?  2
What is Object and Class? What are the differences between them?  3
how do u initialize the constant variables Siemens4
Describe what an Interface is and how it?s different from a Class. Spinsys4
In which cases you use override and new base?  1
 
For more OOPS Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com