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

📄 fmt_ulong.c

📁 Magic C++!的源代码
💻 C
字号:
/* fmt_long.c -- Magic C++ data translate program
   (Mostly) portable public-domain implementation
   -- Copyright(C) 2003 Magicunix Infomation Technology Limited 
   This file is part of magicd.
   magicd is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.
	 
   For details, see the Magic C++ World-Wide-Web page, 
   `http://www.magicunix.com',
   or send a mail to the Magic C++ developers <support@magicunix.com>.
 */

#include "fmt.h"

unsigned int fmt_ulong(s,u) register char *s; register unsigned long u;
{
  register unsigned int len; register unsigned long q;
  len = 1; q = u;
  while (q > 9) { ++len; q /= 10; }
  if (s) {
    s += len;
    do { *--s = '0' + (u % 10); u /= 10; } while(u); /* handles u == 0 */
  }
  return len;
}

⌨️ 快捷键说明

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