stdlib.h和stdio.h有什么区别
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()等函数。
三、定义类型不同
c语言和c++区别1、stdlib.h定义了size_t、wchar_t、div_t、ldiv_t和lldiv_t五种类型。
2、stdio没有定义类型。
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论