Dynamic Memory Allocate-Deallocate by malloc() free()|Practical Session 20|ratan agarwal it informer
Channel: RATAN AGARWAL
Date: 2022-05-06

#msratanagarwal #Cprogrammingtutorials #DynamicMemoryAllocationinC #mallocfunctioninc

Dynamic Memory Allocate-Deallocate by malloc() free()|Practical Session 20

C malloc() method
The “malloc” or “memory allocation” method in C is used to dynamically allocate a single large block of memory with the specified size.
 It returns a pointer of type void which can be cast into a pointer of any form. 
It doesn’t Initialize memory at execution time so that it has initialized each block with the default garbage value initially. 

Syntax: 
ptr = (cast-type*) malloc(byte-size)
For Example:
ptr = (int*) malloc(100 * sizeof(int));

Since the size of int is 4 bytes, this statement will allocate 400 bytes of memory. And, the pointer ptr holds the address of the first byte in the allocated memory.
If space is insufficient, allocation fails and returns a NULL pointer.

If you do not know pointer then see my playlist and learn  https://www.youtube.com/playlist?list=PLUclT6s7BSrNhEv-tmPIQvox18n0rKCY-

Question asked –
How memory is allocated in malloc?
Where does malloc allocate memory in C?
How memory allocated by malloc () or calloc () function can be deallocated?
Which type of memory is allocated with malloc?
How dynamic memory allocated in c ?

"Copyright Disclaimer under Section 107 of the copyright act 1976, allowance is made for fair use for purposes such as criticism, comment, news reporting, scholarship, and research. Fair use is a use permitted by copyright statute that might otherwise be infringing.”

welcome to our channel 
Userid - UCx0auwxIXi1mnmBBv8Cgmyg
CHANNEL id - https://www.youtube.com/channel/UCx0auwxIXi1mnmBBv8Cgmyg
Customize channel id -  https://www.youtube.com/c/RATANAGARWALITINFORMER
short link of channel  http://bit.ly/3eH6m5d  
Join on Telegram- https://t.me/techratanagarwal
OUR SOCIAL MEDIA Watch us on
Facebook page- https://www.facebook.com/msratanagarwal 
Facebook group- https://www.facebook.com/groups/229087104980049
Peep us on Instagram: https://www.instagram.com/ratanagarwal67/
Fly with us on Twitter: https://twitter.com/msratanagarwal
SHARE this video with your friends 
Also Check out these playlists:- 
PLAYLISTs-
Windows 10- https://www.youtube.com/playlist,list=PLUclT6s7BSrPNr8gso5E49GOdEH28vLEf
YouTube assets- https://www.youtube.com/playlist,list=PLUclT6s7BSrO6HLM8Oq2ChWonDS-j_vIy
Short video https://www.youtube.com/playlist?list=PLUclT6s7BSrNku9f0IsaV6brCns5tPL5T
Python -https://www.youtube.com/playlist?list=PLUclT6s7BSrNB36fzjtA1lmzSNBzTxJeo 
Animation in C - https://www.youtube.com/playlist?list=PLUclT6s7BSrPgvE3eNxCz46YAtL9tZlMg
HTML   https://www.youtube.com/playlist?list=PLUclT6s7BSrN_hqZCTmN0CYRr32P3D8b9
JavaScript   https://www.youtube.com/playlist?list=PLUclT6s7BSrMQowWfH3LXyZ0r0YLivoi0
Quiz and story https://www.youtube.com/playlist?list=PLUclT6s7BSrMYMSfDslna5M67w4IMFF53 
Message and blog https://www.youtube.com/playlist?list=PLUclT6s7BSrONG0SfsDqlVYAvkWzUffN    
Latest technology https://www.youtube.com/playlist?list=PLUclT6s7BSrNVD-VMNSSBMkVQv856Tu0g
app and security https://www.youtube.com/playlist?list=PLUclT6s7BSrNXVnFdgFkSFILOS-HNm16K  
daily use app- https://www.youtube.com/playlist?list=PLUclT6s7BSrPc1FGqDT7ntv08UTNR7AZA
Network https://www.youtube.com/playlist?list=PLUclT6s7BSrPMgnqNeMqTCCTWDFTEz17n 
access https://www.youtube.com/playlist?list=PLUclT6s7BSrNC0Shgkmc6PN0zobzIe8Od   
excel https://www.youtube.com/playlist?list=PLUclT6s7BSrMzEMcxhCLCFBt1j0-vgE5z     
word https://www.youtube.com/playlist?list=PLUclT6s7BSrNYiKa3oyS_7spZ-ZEtjf6m
power point https://www.youtube.com/playlist?list=PLUclT6s7BSrOcUBZXyICt662W2nCzNHRI   
Skill education https://www.youtube.com/playlist?list=PLUclT6s7BSrM0Vf05uYRUDCCNhw2NmWzl    
Phone https://www.youtube.com/playlist?list=PLUclT6s7BSrNM-_KuKHomcjW-DkedNnI- 
flash https://www.youtube.com/playlist?list=PLUclT6s7BSrP4-QQDTkfQOVGIGyUAltrH 
Quiz and story https://www.youtube.com/playlist?list=PLUclT6s7BSrMYMSfDslna5M67w4IMFF53 
outlookhttps://www.youtube.com/playlist?list=PLUclT6s7BSrMmH8N41EUNWCWJvPbXjftL

#newyoutuberhelp #SpreadingGyan #ManojDey #Technicalyogi #Technicalisrar