简体   繁体   English

睡眠功能不起作用

[英]Sleep function doesn't work

I am using Xcode and I have just started using the sleep() function but for some reason Xcode keeps saying Use of undeclared identifier 'sleep' . 我正在使用Xcode,我刚刚开始使用sleep()函数,但由于某种原因,Xcode一直在说Use of undeclared identifier 'sleep'

Is there anyway around this? 有没有办法解决? (As you can tell I'm quite new to C++) (你可以说我对C ++很新)

This may be because you haven't introduced the unistd.h header file. 这可能是因为您没有引入unistd.h头文件。

Hope this helps! 希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM