想知道什么时候需要写#include<stdlib.h>, 不知道它的作用是什么

关注类例型如size_t、wchar_t、div_t、ldiv_t和lldiv_t;
宏例如EXIT_FAILURE、EXIT_SUCCESS、RAND_MAX和MB_CUR_MAX等等;
常用的函数如malloc()、calloc()、realloc()、free()、system()、atoi()、atol()、rand()、srand()等等。
参考:
https://zhidao.baidu.com/question/209201368117766565.html