
C语言学习
Feyico
The select life of Walter Mitty
展开
-
C语言去除字符串首尾空格
char * strim(char *str)//去除首尾的空格 { char *end,*sp,*ep; int len; sp = str; end = str + strlen(str) - 1; ep = end; while(sp<=end && isspace(*sp))// *sp == ' '也可以 sp++; while(ep>=s...原创 2018-03-16 20:06:54 · 11110 阅读 · 3 评论 -
STM32中整型数和字符的相互转换
//整形转字符,stm32不支持标准的itoa,这里自己实现 char *myitoa(int value, char *string, int radix) { int i, d; int flag = 0; char *ptr = string; /* This implementation only works for decimal ...原创 2018-04-08 21:26:24 · 15708 阅读 · 0 评论