分页: 1 / 1

求助:为何无法找到<time.h><window.h>。。。。。。

发表于 : 2007-06-21 17:11
utnubudnai
我用Anjuta编辑C程序,想用到SLEEP()函数,可是却找不到像time.h,window.h这些头文件,怎样解决呢?

发表于 : 2007-06-21 21:46
antonym55
#include <unistd.h>

Linux 不是windows 所以没有 windows.h

发表于 : 2007-06-23 15:14
utnubudnai
那其它文件呢?比如说time.h呢?

发表于 : 2007-06-23 15:25
antonym55
utnubudnai 写了:那其它文件呢?比如说time.h呢?
#include<time.h>

发表于 : 2007-06-24 18:33
feixu911
教你查看函数调用的头文件
前提是你要安装gcc-doc文件哟
$man 3 函数名
比如上面那位兄弟的问题

代码: 全选

$man 3 sleep 
郁闷无法直接传图像上来

代码: 全选

SLEEP(3)                   Linux Programmer’s Manual                  SLEEP(3)

NAME
       sleep - Sleep for the specified number of seconds

SYNOPSIS
       #include <unistd.h>

       unsigned int sleep(unsigned int seconds);

DESCRIPTION
       sleep()  makes  the  current  process  sleep until seconds seconds have
       elapsed or a signal arrives which is not ignored.

RETURN VALUE
       Zero if the requested time has elapsed, or the number of  seconds  left
       to sleep.

CONFORMING TO
       POSIX.1-2001.

BUGS
       sleep()  may  be implemented using SIGALRM; mixing calls to alarm() and
 Manual page sleep(3) line 1

发表于 : 2007-06-24 18:39
iblicf
你可以 locate time.h