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

软件和网站开发以及相关技术探讨
回复
头像
utnubudnai
帖子: 53
注册时间: 2007-06-20 15:45

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

#1

帖子 utnubudnai » 2007-06-21 17:11

我用Anjuta编辑C程序,想用到SLEEP()函数,可是却找不到像time.h,window.h这些头文件,怎样解决呢?
antonym55
帖子: 353
注册时间: 2007-04-03 9:52
联系:

#2

帖子 antonym55 » 2007-06-21 21:46

#include <unistd.h>

Linux 不是windows 所以没有 windows.h
头像
utnubudnai
帖子: 53
注册时间: 2007-06-20 15:45

#3

帖子 utnubudnai » 2007-06-23 15:14

那其它文件呢?比如说time.h呢?
antonym55
帖子: 353
注册时间: 2007-04-03 9:52
联系:

#4

帖子 antonym55 » 2007-06-23 15:25

utnubudnai 写了:那其它文件呢?比如说time.h呢?
#include<time.h>
feixu911
帖子: 53
注册时间: 2006-04-21 18:31

#5

帖子 feixu911 » 2007-06-24 18:33

教你查看函数调用的头文件
前提是你要安装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
头像
iblicf
帖子: 3766
注册时间: 2007-01-15 17:15

#6

帖子 iblicf » 2007-06-24 18:39

你可以 locate time.h
回复