一、C语言概述
至此,C标准函数库共有29个头文件:
名字 | 源自 | 描述 |
---|---|---|
<assert.h> | 断言宏,用来调试 | |
<complex.h> | C99 | 一组操作复数的函数 |
<ctype.h> | 用来根据类型来给字符分类,或者进行大小写转换 | |
<errno.h> | 用来测试由库函数报的错误代码 | |
<fenv.h> | C99 | 定义了一组用来控制浮点数环境的函数 |
<float.h> | 定义了用于浮点数库特定实现的宏常量 | |
<inttypes.h> | C99 | 定义精确的宽度整数类型 |
<iso646.h> | NA1 | 定义几个等效于C中某些运算符的宏 |
<limits.h> | 定义了用于整数库特定实现属性的宏常量 | |
<locale.h> | 定义了C语言本地化函数 | |
<math.h> | 定义C语言数学函数 | |
<setjmp.h> | 定义了宏setjmp和longjmp,在非局部跳转的时候使用 | |
<signal.h> | 定义C语言信号处理函数 | |
<stdalign.h> | C11 | 用于查询和指定对象的数据结构对齐方式 |
<stdarg.h> | 用于查询和指定对象的数据结构对齐方式 | |
<stdatomic.h> | C11 | 用于查询和指定对象的数据结构对齐方式 |
<stdbool.h> | C99 | 定义布尔数据类型 |
<stddef.h> | 定义了几个常见的类型与宏 | |
<stdint.h> | C99 | 定义精确的宽度整数类型 |
<stdio.h> | 定义输入输出函数 | |
<stdlib.h> | 数值转换函数、伪随机数生成函数、动态内存分配函数、过程控制函数 | |
<stdnoreturn.h> | C11 | For specifying non-returning functions |
<string.h> | 定义C语言字符串处理函数 | |
<tgmath.h> | C99 | Defines type-generic mthematical functions |
<threads.h> | C11 | 关于线程的 |
<time.h> | 关于时间处理的 | |
<uchar.h> | C11 | 关于字符处理的 |
<wchar.h> | NA1 | 关于字符处理的 |
<wctype.h> | NA1 | 关于字符 |
#include <stdio.h>
int main()
{
char str1[]="Hello,"; //引号内为字符串数组的数据
char str2[]="World!";
printf("%s%s\n","str1","str2");//输出结果是str1str2,因为存在引号将str1str2视为字符串输出
printf("%s%s\n",str1,str2);//输出为Hello,World!,此时取输出字符串str1str2中的数据
return 0;
}