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

📄 crtsupplement.c

📁 ReactOS是一些高手根据Windows XP的内核编写出的类XP。内核实现机理和API函数调用几乎相同。甚至可以兼容XP的程序。喜欢研究系统内核的人可以看一看。
💻 C
字号:
/* $Id: CrtSupplement.c 15091 2005-05-07 21:24:31Z sedwards $
 *
 * Written by EA because ReactOS hasn't yet _ui64toa()
 * (it's in msvcrt.dll, and not in crtdll.dll).
 */

#include <stdlib.h>

static
char DigitMap [] = "0123456789abcdefghijklmnopqrstuvwxyz";

char *
_ui64toa (
	unsigned __int64	value,
	char			* string,
	int			radix
	)
{
	int	reminder = 0;
	char	buffer [17];
	char	* w = buffer;
	int	len = 0;
	int	i = 0;

	/* Check the radix is valid */
	if ((2 > radix) || (36 < radix))
	{
		return string;
	}
	/* Convert the int64 to a string */
	do {
		reminder = (int) (value % (__int64) radix);
		*(w ++) = DigitMap [reminder];
		value /= (__int64) radix;
		++ len;

	} while ((__int64) value > 0);
	/* Reverse the string */
	while (i < len)
	{
		string [i ++] = *(-- w);
	}
	string [len] = '\0';

	return string;
}



/* EOF */

⌨️ 快捷键说明

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