善于使用C库函数会使编程很方便,本着多学习的态度,自己写这些函数是好的,但是使用库函数会减轻你的劳动,并且会让你的主函数很清洁,看了很舒服。 1. Character Type Functions - 字符类型函数 2. Standard C Input/Output Functions - 标准输入输出函数 3. Standard Library Functions - 标准库和内存分配函数 4. Mathematical Functions - 数学函数 5. String Functions - 字符串函数 6. BCD Conversion Functions - BCD 转换函数 7. Memory Access Functions - 存储器访问函数 8. Delay Functions - 延时函数 9. LCD Functions - LCD函数 10. LCD Functions for displays with 4x40 characters - 4×40 字符型LCD函数 11. LCD Functions for displays connected in 8 bit memory mapped mode -以8 位外部存储 器模式接口的LCD显示函数 12. I2C Bus Functions - I2C 总线函数 13. National Semiconductor LM75 Temperature Sensor Functions - LM75 温度传感器函数 14. Dallas Semiconductor DS1621 Thermometer/Thermostat Functions - DS1621 温度计函 数 15. Philips PCF8563 Real Time Clock Functions - PCF8563 实时时钟函数 16. Philips PCF8583 Real Time Clock Functions - PCF8583 实时时钟函数 17. Dallas Semiconductor DS1302 Real Time Clock Functions - DS1302 实时时钟函数 18. Dallas Semiconductor DS1307 Real Time Clock Functions - DS1307 实时时钟函数 19. 1 Wire Protocol Functions - 单线通讯协议函数 20. Dallas Semiconductor DS1820/DS1822 Temperature Sensors Functions - DS1820/1822 温度传感器函数 21. SPI Functions - SPI 函数 22. Power Management Functions - 电源管理函数 23. Gray Code Conversion Functions - 格雷码转换函数 24、字符串库(string.h) 25、字符串连接(相加) char *strcat(char *dest,const char *stc) 把src连接到dest字符串后面,返回指向dest的指针 26、字符串比较 int strcmp(char *str1,char *str2) 返回值:小于0: str1str2 27、字符串拷贝1 char *strcpy(char *dest,const char *src) 结果把src的内容拷进dest,两个字符串内容相同,返回指向dest的指针 28、字符串拷贝2 char *strdup(const char *src) src:待拷贝的源字符串,返回值:指向拷贝后的字符串的指针 29、字符串倒序 char *strrev(char *s); 返回指向倒序后字符串的指针 30、类型转换(math.h; stdlib.h) 31、字符串转双精度(类似C Builder里的StrToDouble) double atof(char *str) 32、字符串转整数(类似StrToInt) int atoi(char *str) 33、字符串转长整型 long atol(char *str) 34、浮点数转字符串 char *ecvt(double value,int ndigit,int*dec,int *sign) char *fcvt(double value,int ndigit,int*dec,int *sign) 输入参数:value: 待转换浮点数,ndigit: 转换后的字符串长度 输出参数:dec: 小数点位置,sign: 符号 返回转换后的字符串指针 35、整型转字符串 char *itoa(int value,char *string,int radix) 输入参数:value: 要转换的数,radix: 转换的进制 输出参数:string: 转换后的字符串 36、返回指向string的指针 长整型转字符串 char *ltoa(long value,char *string,int radix)
|