20020503-1.c

来自「this is a gcc file, you can download it 」· C语言 代码 · 共 32 行

C
32
字号
/* PR 6534 *//* GCSE unified the two i<0 tests, but if-conversion to ui=abs(i)    insertted the code at the wrong place corrupting the i<0 test.  */void abort (void);static char *inttostr (long i, char buf[128]){  unsigned long ui = i;  char *p = buf + 127;  *p = '\0';  if (i < 0)    ui = -ui;  do    *--p = '0' + ui % 10;  while ((ui /= 10) != 0);  if (i < 0)    *--p = '-';  return p;}intmain (){  char buf[128], *p;  p = inttostr (-1, buf);  if (*p != '-')    abort ();  return 0;}

⌨️ 快捷键说明

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