rdsysdt2.c
来自「TC与BC++用户界面程序设计 《Turbo CBorland C++用户界」· C语言 代码 · 共 16 行
C
16 行
/* RDSYSDT2.C -- 读取系统日期并输出,用int86()函数
*/
#include "dos.h"
#include "conio.h"
int main()
{
union REGS In, Out; /* 定义结构变量 */
In.h.ah = 0x2a; /* 设置DOS 21H类中断功能调用2AH */
int86(0x21, &In, &Out); /* 执行中断 */
printf("%4d年%2d月%2d日\n", Out.x.cx, Out.h.dh, Out.h.dl);
printf("星期%1d\n", Out.h.al);
getch();
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?