InterviewUp is actively seeking partnerships. Inquire at business@interviewup.com

Questions 1 - 5 of 5
Close
Flag this interview question as inappropriate Inappropriate
See Answer
The free subroutine frees a block of memory previously allocated by the malloc subroutine. Undefined results occur if the Pointer parameter is not a valid pointer. If the Pointer parameter is a null value, no action will occur. The realloc subroutine changes the size of the block of memory pointed to by the Pointer parameter to the number of bytes specified by the Size parameter and returns a new pointer to the block. The pointer specified by the Pointer parameter must have been created with the malloc, calloc, or realloc subroutines and not been deallocated with the free or realloc subroutines. Undefined results occur if the Pointer parameter is not a valid pointer.
Create Date
:
Sunday, April 27, 2008
Tags
:
Asked At
:
None
Job Positions
:
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
Flag this interview question as inappropriate Inappropriate
See Answer
most of the times you need to zero out the mem by using bzero or memset.U need not do it that way here.And also if it is to be alocated for a string,strlen(allocated array) is automatically 0.Which is a much safer method
Create Date
:
Saturday, March 15, 2008
Asked At
:
None
Job Positions
:
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
Flag this interview question as inappropriate Inappropriate
See Answer
while programming if the memory is allocated by malloc of calloc but free() is not called at the end
of usage of the memory chunk, it remains allocated..and can be dangerous..
these are very important in case of development of large products..
often programers do not intentionally leave the memory allocated..but there may be situation
when the control is passed to a different portion of code and needs to be freed there

Memory leaks are extremely dangerous...
Create Date
:
Tuesday, January 15, 2008
Tags
:
None
Asked At
:
None
Job Positions
:
None
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
Flag this interview question as inappropriate Inappropriate
See Answer

This is a very interesting and interviewers favourite for C
both are memory allocation functions

malloc is system call

calloc is c library call

when malloced the memory is uninitialised

when calloced the memory is initialised to all 0's

For malloc we specify the number of bytes
for calloc we specify  the number * datatype.

Create Date
:
Monday, January 14, 2008
Tags
:
None
Asked At
:
None
Job Positions
:
None
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
Flag this interview question as inappropriate Inappropriate
See Answer
The heap is where malloc(), calloc(), and realloc() get memory.
Getting memory from the heap is much slower than getting it from the stack. On the other hand, the heap is much more flexible than the stack. Memory can be allocated at any time and deallocated in any order. Such memory isn't deallocated automatically; you have to call free().
Create Date
:
Tuesday, September 11, 2007
Asked At
:
None
Job Positions
:
None
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 


Check out our newest job listings!

Post a Job! $49 for 60 days




InterviewUp is actively seeking partnerships. Inquire at business@interviewup.com

Suggestions & Comments




Share Your Interview Questions
Ask Interview Questions
View Unanswered Questions

















Advertise on this site