回 帖 发 新 帖 刷新版面

主题:Turbo C 2.0 函数中文说明大全系列

================分类函数(原型声明所在头文件为ctype.h)=====================
int isalpha(int ch)  若ch是字母('A'-'Z','a'-'z')返回非0值,否则返回0
int isalnum(int ch)  若ch是字母('A'-'Z','a'-'z')或数字('0'-'9')
                     返回非0值,否则返回0
int isascii(int ch)  若ch是字符(ASCII码中的0-127)返回非0值,否则返回0
int iscntrl(int ch)  若ch是作废字符(0x7F)或普通控制字符(0x00-0x1F)
                     返回非0值,否则返回0
int isdigit(int ch)  若ch是数字('0'-'9')返回非0值,否则返回0
int isgraph(int ch)  若ch是可打印字符(不含空格)(0x21-0x7E)返回非0值,否则返回0
int islower(int ch)  若ch是小写字母('a'-'z')返回非0值,否则返回0
int isprint(int ch)  若ch是可打印字符(含空格)(0x20-0x7E)返回非0值,否则返回0
int ispunct(int ch)  若ch是标点字符(0x00-0x1F)返回非0值,否则返回0
int isspace(int ch)  若ch是空格(' '),水平制表符('\t'),回车符('\r'),
                     走纸换行('\f'),垂直制表符('\v'),换行符('\n')
                     返回非0值,否则返回0
int isupper(int ch)  若ch是大写字母('A'-'Z')返回非0值,否则返回0
int isxdigit(int ch) 若ch是16进制数('0'-'9','A'-'F','a'-'f')返回非0值,
                     否则返回0
int tolower(int ch)  若ch是大写字母('A'-'Z')返回相应的小写字母('a'-'z')
int toupper(int ch)  若ch是小写字母('a'-'z')返回相应的大写字母('A'-'Z')

回复列表 (共11个回复)

11 楼

===========时间日期函数(原型声明所在头文件为time.h、dos.h)========
在时间日期函数里,主要用到的结构有以下几个:
总时间日期贮存结构tm
┌──────────────────────┐
│struct tm                                   │
│{                                           │
│ int tm_sec;   /*秒,0-59*/                  │
│ int tm_min;   /*分,0-59*/                  │
│ int tm_hour;  /*时,0-23*/                  │
│ int tm_mday;  /*天数,1-31*/                │
│ int tm_mon;   /*月数,0-11*/                │
│ int tm_year;  /*自1900的年数*/             │
│ int tm_wday;  /*自星期日的天数0-6*/        │
│ int tm_yday;  /*自1月1日起的天数,0-365*/   │
│ int tm_isdst; /*是否采用夏时制,采用为正数*/│
│}                                           │
└──────────────────────┘
日期贮存结构date
┌───────────────┐
│struct date                   │
│{                             │
│ int da_year; /*自1900的年数*/│
│ char da_day; /*天数*/        │
│ char da_mon; /*月数 1=Jan*/  │
│}                             │
└───────────────┘
时间贮存结构time
┌────────────────┐
│struct time                     │
│{                               │
│ unsigned char ti_min;  /*分钟*/│
│ unsigned char ti_hour; /*小时*/│
│ unsigned char ti_hund;         │
│ unsigned char ti_sec;  /*秒*/  │
│                                │
└────────────────┘
char      *ctime(long *clock)
            本函数把clock所指的时间(如由函数time返回的时间)转换成下列格式的
            字符串:Mon Nov 21 11:31:54 1983\n\0
char      *asctime(struct tm *tm)
            本函数把指定的tm结构类的时间转换成下列格式的字符串:
            Mon Nov 21 11:31:54 1983\n\0
double     difftime(time_t time2,time_t time1)
            计算结构time2和time1之间的时间差距(以秒为单位)
struct tm *gmtime(long *clock)本函数把clock所指的时间(如由函数time返回的时间)
            转换成格林威治时间,并以tm结构形式返回
struct tm *localtime(long *clock)本函数把clock所指的时间(如函数time返回的时间)
            转换成当地标准时间,并以tm结构形式返回
void       tzset()本函数提供了对UNIX操作系统的兼容性
long       dostounix(struct date *dateptr,struct time *timeptr)
            本函数将dateptr所指的日期,timeptr所指的时间转换成UNIX格式,并返回
            自格林威治时间1970年1月1日凌晨起到现在的秒数
void       unixtodos(long utime,struct date *dateptr,struct time *timeptr)
            本函数将自格林威治时间1970年1月1日凌晨起到现在的秒数utime转换成
            DOS格式并保存于用户所指的结构dateptr和timeptr中
void       getdate(struct date *dateblk)本函数将计算机内的日期写入结构dateblk
            中以供用户使用
void       setdate(struct date *dateblk)本函数将计算机内的日期改成
            由结构dateblk所指定的日期
void       gettime(struct time *timep)本函数将计算机内的时间写入结构timep中,
            以供用户使用
void       settime(struct time *timep)本函数将计算机内的时间改为
            由结构timep所指的时间
long       time(long *tloc)本函数给出自格林威治时间1970年1月1日凌晨至现在所经
            过的秒数,并将该值存于tloc所指的单元中.
int        stime(long *tp)本函数将tp所指的时间(例如由time所返回的时间)
            写入计算机中.

我来回复

您尚未登录,请登录后再回复。点此登录或注册