1.Cè¯è¨ printfåscanfçå®ç°
Cè¯è¨ printfåscanfçå®ç°
/* Write formatted output to stdout from the format string FORMAT. */
/* VARARGS1 */
int
__printf (const char *format,源码通达信源码如何只显示整数 ...)
{
va_list arg;
int done;
va_start (arg, format);
done = vfprintf (stdout, format, arg);
va_end (arg);
return done;
}
int _scanf(char (*get)(void), void (*unget)(char), CONST char *fmt, va_list va)
{
int is_long, c, base;
char *vp;
char s[MAX+1];
int converted = 0;
while (c = *fmt++)
{
if (c == '%')
{
if (*fmt == 'l')
{
is_long = 1;
fmt++;
}
else
is_long = 0;
vp = va_arg(va, void *);
switch (*fmt)
{
case 'c':
*(char *)vp = get();
converted++;
break;
case 'o': base = 8; goto read_strtoul;
case 'u': base = ; goto read_strtoul;
case 'X':
case 'x': base = ;
read_strtoul:
converted++;
ReadInteger(s, get, unget, base);
if (is_long)
*(unsigned long *)vp = strtoul(s, 0, base);
else
*(unsigned *)vp = strtoul(s, 0, base);
break;
case 'd':
converted++;
ReadInteger(s, get, unget, );
if (is_long)
*(long *)vp = strtol(s, 0, );
else
*(int *)vp = strtol(s, 0, );
break;
case 's':
converted++;
ReadString(vp, get, unget);
break;
default:
puts("unsupported format");
break;
}
fmt++;
}
else if (isspace(c))
{
while ((c = get()) && isspace(c))
;
unget(c);
}
else if (get() != c)
break;
}
return converted;
}
台南天坑墜車「吊車救援也翻」 漏夜灌漿填平凌晨2時恢復通車
神兽源码漏洞_神兽源码漏洞怎么解决
论坛社区 源码_论坛社区 源码怎么找
工资系统 源码_工资管理系统源代码
拉脫維亞發現「不明飛行物」越境 北約戰機緊急升空
resnet模型源码