From 97284992ec865c4ebdd7e7dcb86c65896422d117 Mon Sep 17 00:00:00 2001 From: Mahesh Jaganiya <34797952+jagzmz@users.noreply.github.com> Date: Mon, 8 Apr 2019 20:24:04 +0530 Subject: [PATCH] Added malloc() review (#33307) --- guide/english/c/malloc/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/guide/english/c/malloc/index.md b/guide/english/c/malloc/index.md index 3564054059..317764b8fd 100644 --- a/guide/english/c/malloc/index.md +++ b/guide/english/c/malloc/index.md @@ -68,6 +68,7 @@ int main() * Malloc is used for dynamic memory allocation and is useful when you don't know the amount of memory needed during compile time. * Allocating memory allows objects to exist beyond the scope of the current block. * C passes by value instead of reference. Using malloc to assign memory, and then pass the pointer to another function, is more efficient than having the function recreate the structure. +* ```malloc()``` reserves a block of memory of specified size and return a pointer of type void which can be casted into pointer of any form. Difference between malloc() and calloc() 1. Malloc() does not assignes the created memory to zero where as calloc() assignes the memory created to zero.