⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 strtoul.c

📁 minimal python variant for small footprint apps like embedded apps
💻 C
字号:
/* *  linux/lib/string.c * *  Copyright (C) 1991, 1992  Linus Torvalds */#include <sys/types.h>#include <string.h>#include <ctype.h>#ifndef __HAVE_ARCH_STRTOULunsigned long strtoul(const char *cp,char **endp,unsigned int base){  unsigned long result = 0,value;    if (!base) {    base = 10;    if (*cp == '0') {      base = 8;      cp++;      if ((*cp == 'x') && isxdigit(cp[1])) {	cp++;	base = 16;      }    }  }  while (isxdigit(*cp) && (value = isdigit(*cp) ? *cp-'0' : (islower(*cp) ? toupper(*cp) : *cp)-'A'+10) < base) {    result = result*base + value;    cp++;  }  if (endp)    *endp = (char *)cp;  return result;}#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -