The endl is a predefined object of ostream class. It is used to insert a new line characters and flushes the stream. it used in C++.
Type casting refers to changing an variable of one data type into another. The compiler will automatically change one type of data into another if it makes sense. For instance, if you assign an integer value to a floating-point variable, the compiler will convert the int to a float.
Getch() function is need to be used in some c compilers like turbo c. Getch is used to hold the output sceen and wait until user gives any type of input(i.e. Until user press any key ) so that they can read the character and due to this we able to see the output on the screen.
In C, you should include stdlib.h. This will give you the function prototypes for the family of malloc functions (malloc, calloc, realloc, and free). Some compiler vendors provide access to these functions through other header files as well, but stdlib.h is the most portable one to use.