头文件的延迟功能dos.h
在代码块中不起作用。它表明延迟函数未声明。以下链接包含以下程序。
关联
int main ()
{
printf ( " This c program will exit in 10 seconds.\n");
delay(10000);
return 0;
}
头文件的延迟功能dos.h
在代码块中不起作用。它表明延迟函数未声明。以下链接包含以下程序。
关联
int main ()
{
printf ( " This c program will exit in 10 seconds.\n");
delay(10000);
return 0;
}
我也有同样的问题&我使用了这个功能
#include <time.h>
void delay(int milliseconds)
{
long pause;
clock_t now,then;
pause = milliseconds*(CLOCKS_PER_SEC/1000);
now = then = clock();
while( (now-then) < pause )
now = clock();
}
正如所评论的,这确实使系统忙碌。我有更好的方式来做这件事,并且为 CodeBlocks 工作。
#include <windows.h>
.
.
.
Sleep(100); //sleep for 0.1 second
.
我认为它只适用于turbo c。它是 Borland 特有的,在 turbo c 编译器中工作。