The third C language d

Watch the video to learn 1.22 1.31 1.32

A: Code

II: Paper notes:

Three: Questions and Answers

Question 1: getchar and putchar

Both are of the type int, not char type

Question 2: malloc function

malloc dynamic memory allocation, apply for a contiguous block of memory the size of the area designated to type void * return allocated memory area address, when not know the specific location of the memory when you want to bind the real memory space, you need to use dynamic memory allocation, and allocation size is the size of the procedural requirements.

Question 3: it must be free function

free function and malloc function is complete, because after the inevitable is to apply also, so there must be free space function, go back to the system, otherwise it will collapse.

 

Guess you like

Origin www.cnblogs.com/Qiaor-7/p/12500011.html