General Discussions

malloc( ) in C

PH's avatarPH Bytes

Function malloc() is used to dynamically allocate the memory in C. The general syntax goes the following way:

(type_casting) malloc (size)

let us understand it in detail in the form of a conversation:

malloc1malloc2

That’s how the components of the syntax:
β€œ(type casting the pointer) malloc(specifying the size) β€œ
can be understood.

A sample source code can be seen below:

View original post

Let me Know What you Think!