-2

我是系统编程的新手。我正在尝试使用该puts()功能打印时间间隔,但出现错误。

#include <stdio.h>
#include <DOS.h>
#include <BIOS.h>

unsigned long int far *time = (unsigned long int far*) 0x0040006C;

void main()
{
    unsigned long int tx;
    tx = (*time);
    tx = tx +18;
    puts("Before");
    while((*time) <= tx);
    puts("After");
}

错误截图:

图片

PS:我正在使用 Borland C 编译器和 DOSBox 来运行这些程序。

4

1 回答 1

0

在您的屏幕截图中,您尝试puts使用 int,它只需要char*.

试试这个而不是puts(tx)

printf("%d", tx);
于 2017-05-18T00:29:07.970 回答