Answer Posted / namita
1-memory allocated by malloc contains garbage value.But
memory allocated by calloc is initialised to zero.
2-malloc takes only one argument which indicates the size
to be allocated.But calloc takes two arguments.First
argument indicates the number of blocks to be allocated
where as the second argument indicates the size of the
block.
Is This Answer Correct ? | 35 Yes | 2 No |
Post New Answer View All Answers
What are the general description for loop statement and available loop types in c?
What is the difference between void main and main in c?
Write program to remove duplicate in an array?
Explain what is the difference between text files and binary files?
What is the use of #include in c?
Explain how can I convert a number to a string?
What is else if ladder?
Why void main is used in c?
Explain why c is faster than c++?
What are the __date__ and __time__ preprocessor commands?
Describe the steps to insert data into a singly linked list.
When do we get logical errors?
The purpose of this exercise is to benchmark file writing and reading speed. This exercise is divided into two parts. a). Write a file character by character such that the total file size becomes approximately >10K. After writing close the file handler, open a new stream and read the file character by character. Record both times. Execute this exercise at least 4 times b). Create a buffer capable of storing 100 characters. Now after generating the characters, first store them in the buffer. Once the buffer is filled up, store all the elements in the file. Repeat the process until the total file size becomes approximately >10K.While reading read a while line, store it in buffer and once buffer gets filled up, display the whole buffer. Repeat the exercise at least 4 times with different size of buffer (50, 100, 150 …). Records the times. c). Do an analysis of the differences in times and submit it in class.
Explain what is the heap?
int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;