Write C Program Simulate Calloc Using Malloc Assume Need Perform Memory Allocations 20 Int Q37063965

Write a C program to simulate calloc using malloc. Assume youneed to perform memory allocations for 20 integers.
Remember: calloc resets the memory location to zero whileallocation.Please with comments.


Solution


#include<stdio.h>#include<stdlib.h>int main() { int count = 20, i; int *p; p = (int *)malloc(sizeof(int)*count); //Allocating memory using malloc for (i = 0; i < count; i++)

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.