美文网首页
stdlib.h和stdio.h有什么区别

stdlib.h和stdio.h有什么区别

作者: 肖旭晖 | 来源:发表于2020-09-07 19:48 被阅读0次

C语言标准库 stdlib.h和stdio.h有什么区别

一、定位不同。

1、stdlib.h是standard library标准bai库头文件,定位在通用工具函数。

2、stdio.h是standard input&output标准输入输出头文件,定位在标准的输入输出工具函数。

二、封装函数不同。

1、stdlib.h主要封装了malloc()、calloc()、realloc()、free()、system()、atoi()、atol()、rand()、srand()、exit()等函数。

2、stdio.h主要封装了getchar()、putchar()、scanf()、printf()、gets()、puts()、sprintf()等函数。

三、定义类型不同

1、stdlib.h定义了size_t、wchar_t、div_t、ldiv_t和lldiv_t五种类型。

2、stdio没有定义类型。

相关文章

网友评论

      本文标题:stdlib.h和stdio.h有什么区别

      本文链接:https://www.haomeiwen.com/subject/jqwlektx.html