【c】标准库和常用函数

Target:

1.To describe the c standard libs(section 1) and common functions (section 2)to use


Section 1

1.https://www.onitroad.com/jc/linux/man-pages/linux/man3/open_memstream.3.html


Section 2

  • 字符串函数
funcdescinstance
strlen(s)获取字符串s的长度
strcmp(s1,s2)比较字符串;比较的时候会把字符串转换成ASCII码再进行比较,返回结果为0表示s1和s2的ASCII码值相等,返回结果为1表示s1比s2的ASCII码大,返回结果为-1表示s1比s2的ACSII码小;
strcpy(s1,s2)字符串拷贝;s2会取代s1中的内容
strcat(s1,s2)将s2拼接到s1后面;注意:s1的length要足够才可以
atoi(s1)将字符串转为整数