浏览代码

strlen is already in string.h

or, alternativly one could write size_t strlen(const char *s) {return __builtin_strlen(s);} to use the gcc-builtin function.
I think, both are faster than the bytewise search.
teensy4-core
FrankBoesing 10 年前
父节点
当前提交
7d3da62a48
共有 1 个文件被更改,包括 0 次插入8 次删除
  1. +0
    -8
      teensy3/nonstd.c

+ 0
- 8
teensy3/nonstd.c 查看文件

#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>


size_t strlen(const char *s)
{
size_t n=0;

while (*s++) n++;
return n;
}



char * ultoa(unsigned long val, char *buf, int radix) char * ultoa(unsigned long val, char *buf, int radix)
{ {

正在加载...
取消
保存