Answers were Sorted based on User's Feedback
how do u say calloc is for reallocation???..
Both are serving for the purpose of dynamic memory
But malloc and calloc differs in two ways.
1.After allocating memory using malloc(), the data elements
in the memory will not be initialised. Means, it contains
But calloc() initialise all the data elements to 0.
2.malloc() allocates memory in terms of bytes.it accepts
only one argument, which says no of bytes to be allocated.
But calloc() allocates memory interms of blocks. it is
widely used when there is a need to allocated memory for an
it accepts two arguments, 1st says, no of blocks to be
allocated and next argument says the size of the block.
-> it allocates 40 bytes, if the compiler allocates 4 bytes
for an int variable.
|Is This Answer Correct ?||17 Yes||1 No|
Answer / jothi16
calloc means reallocate the memory.malloc used to allocate
|Is This Answer Correct ?||6 Yes||19 No|
How do you print only part of a string?
What are the string functions? List some string functions available in c.
Tell us two differences between new () and malloc ()?
What is an expression?
any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above
Write a code to generate a series where the next element is the sum of last k terms.
in which language c language is written?
What are the different types of control structures?
In the following control structure which is faster? 1.Switch 2.If-else and which consumes more memory?
Why should I prototype a function?
Why does everyone say not to use gets?