/*
** 字串是不是數字
*/static int isnumber(const char *z, int *realnum)
z++;
if( realnum ) *realnum = 0;
/*找到第乙個不是數字的位置*/
while( isdigit(*z) )
if( *z=='.' )
if( realnum ) *realnum = 1;
}if( *z=='e' || *z=='e' )
if( realnum ) *realnum = 1;
}return *z==0;}/*
** this routine reads a line of text from file in, stores
** the text in memory obtained from malloc() and returns a pointer
** to the text. null is returned at end of file, or if malloc()
** fails.
**** the inte***ce is like "readline" but no command-line editing
** is done.
*/static char *local_getline(file *in)
if( fgets(&zline[n], nline - n, in)==0 )
zline[n] = 0;
eol = 1;
break;
}/*指到最後乙個字元*/
while( zline[n] )
if( n>0 && zline[n-1]=='\n' )
}/*是為了去掉多餘空間*/
zline = realloc( zline, n+1 );
return zline;
}/*陣列大小*/
#define arraysize(x) (int)(sizeof(x)/sizeof(x[0]))
C 常用函式
1 datetime 數字型 system.datetime currenttime new system.datetime 1.1 取當前年月日時分秒 currenttime system.datetime.now 1.2 取當前年 int 年 currenttime.year 1.3 取當前月 ...
c 常用函式
1 datetime 數字型 system.datetime currenttime new system.datetime 1.1 取當前年月日時分秒 currenttime system.datetime.now 1.2 取當前年 int 年 currenttime.year 1.3 取當前月 ...
C 常用函式
1 datetime 數字型 system.datetime currenttime new system.datetime 1.1 取當前年月日時分秒 currenttime system.datetime.now 1.2 取當前年 int 年 currenttime.year 1.3 取當前月 ...