WHAT IS THE DIFFERENCE BETWEEN malloc() and calloc() in c
file management?
Answer Posted / jayakrishnan d
1.malloc is only one argument function while malloc is a
two arguments function.
2.malloc allocates bytes of memory while calloc allocates
array of memory.
3.malloc does not initialize the size of allocated memory ie
gabage value while calloc is initialize size of allocated
memory to '0'.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
FILE PROGRAMMING
What are the uses of null pointers?
Difference between Function to pointer and pointer to function
Explain how do you override a defined macro?
how we can make 3d venturing graphics on outer interface
What is the main difference between calloc () and malloc ()?
What is null pointer in c?
What is dynamic dispatch in c++?
What is New modifiers?
What is a void pointer? When is a void pointer used?
Write a C program to help a HiFi’s Restaurant automate its breakfast billing system. Your assignment should implement the following items: a. Show the customer the different breakfast items offered by the HiFi’s Restaurant. b. Allow the customer to select more than one item from the menu. c. Calculate and print the bill to the customer. d. Produce a report to present your complete program and show more sample output. Assume that the HiFi’s Restaurant offers the following breakfast menu: Plain Egg $2.50 Bacon and Egg $3.45 Muffin $2.20 French Toast $2.95 Fruit Basket $3.45 Cereal $0.70 Coffee $1.50 Tea $1.80
What is c programming structure?
#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }
How do we open a binary file in Read/Write mode in C?
Write a code to generate divisors of an integer?