C 中的 delay() 是什么?是系统函数吗?
What is delay() in C? Is it a system function?
在一本书上,看到一段代码。
但是当我运行这段代码时它说:
C:\Users\dipankar\Desktop\cla.cpp [错误] 'delay' 未在此范围内声明
他们在没有适当文档的情况下使用了它。他们只说 "delay() is used to delay the execution of the next line by few milliseconds"!!。
请帮忙
这是一个毫秒延迟函数。它的定义位置在很大程度上取决于您编译的对象 platform/toolchain。通常会在 <time.h>
中找到
我不知道 C 标准中有任何睡眠函数。但是,您可以在 Linux.
中为此目的使用 nanosleep
(https://linux.die.net/man/2/nanosleep)
您正在阅读的这本书是垃圾。避开这本书并告诉其他人也这样做。
<conio.h>
是 system-specific header 并且不保证在许多平台上可用。
- The result of
fgetc
must never be stored in a char
variable.
- The function
feof
must never be used in a loop condition.
这本书可能来自 1980 年代或 90 年代初。 Turbo Pascal 中有一个函数 delay
需要毫秒。也许这就是作者的意思。
在一本书上,看到一段代码。
但是当我运行这段代码时它说: C:\Users\dipankar\Desktop\cla.cpp [错误] 'delay' 未在此范围内声明
他们在没有适当文档的情况下使用了它。他们只说 "delay() is used to delay the execution of the next line by few milliseconds"!!。 请帮忙
这是一个毫秒延迟函数。它的定义位置在很大程度上取决于您编译的对象 platform/toolchain。通常会在 <time.h>
我不知道 C 标准中有任何睡眠函数。但是,您可以在 Linux.
中为此目的使用nanosleep
(https://linux.die.net/man/2/nanosleep)
您正在阅读的这本书是垃圾。避开这本书并告诉其他人也这样做。
<conio.h>
是 system-specific header 并且不保证在许多平台上可用。- The result of
fgetc
must never be stored in achar
variable. - The function
feof
must never be used in a loop condition.
这本书可能来自 1980 年代或 90 年代初。 Turbo Pascal 中有一个函数 delay
需要毫秒。也许这就是作者的意思。