What is the proper #include for the function 'sleep()'?

后端 未结 5 1003
北海茫月
北海茫月 2020-11-28 23:09

I am using the Big Nerd Ranch book Objective-C Programming, and it starts out by having us write in C in the first few chapters. In one of my programs it has me create, I us

5条回答
  •  没有蜡笔的小新
    2020-11-28 23:47

    sleep(3) is in unistd.h, not stdlib.h. Type man 3 sleep on your command line to confirm for your machine, but I presume you're on a Mac since you're learning Objective-C, and on a Mac, you need unistd.h.

提交回复
热议问题