gcc怎么查看某个函数包含在哪个头文件及其使用方法
我用的是ubuntu在网上查了一下,比如说我想查sleep()函数的用法及其所在的头文件可以这样mansleep但出来的说明似乎没有MSDN讲得那么容易理解,而且我也找不...
我用的是ubuntu
在网上查了一下,比如说我想查sleep()函数的用法及其所在的头文件
可以这样man sleep
但出来的说明似乎没有MSDN讲得那么容易理解,而且我也找不到有#incldue这个关键字。无法知道这个函数是包含在哪个头文件。 展开
在网上查了一下,比如说我想查sleep()函数的用法及其所在的头文件
可以这样man sleep
但出来的说明似乎没有MSDN讲得那么容易理解,而且我也找不到有#incldue这个关键字。无法知道这个函数是包含在哪个头文件。 展开
3个回答
展开全部
man 可比msdn好用多了
man 3 sleep (如果直接 man sleep ,查看的是 sleep 这个命令的手册,而不是sleep()函数的手册,你的问题应该就是由于这个导致的看错文档导致的)
就可以看到如下的说明,它明确的告诉了你需要 #include <unistd.h>,还提供了其他详细说明。
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 calling thread 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, if the call was interrupted by a signal handler.
CONFORMING TO
POSIX.1-2001.
BUGS
sleep() may be implemented using SIGALRM; mixing calls to alarm(2) and
sleep() is a bad idea.
Using longjmp(3) from a signal handler or modifying the handling of
SIGALRM while sleeping will cause undefined results.
SEE ALSO
alarm(2), nanosleep(2), signal(2), signal(7)
COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
GNU 2010-02-03 SLEEP(3)
man 3 sleep (如果直接 man sleep ,查看的是 sleep 这个命令的手册,而不是sleep()函数的手册,你的问题应该就是由于这个导致的看错文档导致的)
就可以看到如下的说明,它明确的告诉了你需要 #include <unistd.h>,还提供了其他详细说明。
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 calling thread 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, if the call was interrupted by a signal handler.
CONFORMING TO
POSIX.1-2001.
BUGS
sleep() may be implemented using SIGALRM; mixing calls to alarm(2) and
sleep() is a bad idea.
Using longjmp(3) from a signal handler or modifying the handling of
SIGALRM while sleeping will cause undefined results.
SEE ALSO
alarm(2), nanosleep(2), signal(2), signal(7)
COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
GNU 2010-02-03 SLEEP(3)
展开全部
我用的是ubuntu
在网上查了一下,比如说我想查sleep()函数的用法及其所在的头文件
可以这样man sleep
man 3 sleep (如果直接 man sleep ,查看的是 sleep 这个命令的手册,而不是sleep()函数的手册,你的问题应该就是由于这个导致的看错文档导致的)
就可以看到如下的说明,它明确的告诉了你需要 #include <unistd.h>,还提供了其他详细说明。
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 calling thread 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, if the call was interrupted by a signal handler.
CONFORMING TO
POSIX.1-2001.
BUGS
sleep() may be implemented using SIGALRM; mixing calls to alarm(2) and
sleep() is a bad idea.
Using longjmp(3) from a signal handler or modifying the handling of
SIGALRM while sleeping will cause undefined results.
SEE ALSO
alarm(2), nanosleep(2), signal(2), signal(7)
COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
我的答案行吗?请采纳
在网上查了一下,比如说我想查sleep()函数的用法及其所在的头文件
可以这样man sleep
man 3 sleep (如果直接 man sleep ,查看的是 sleep 这个命令的手册,而不是sleep()函数的手册,你的问题应该就是由于这个导致的看错文档导致的)
就可以看到如下的说明,它明确的告诉了你需要 #include <unistd.h>,还提供了其他详细说明。
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 calling thread 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, if the call was interrupted by a signal handler.
CONFORMING TO
POSIX.1-2001.
BUGS
sleep() may be implemented using SIGALRM; mixing calls to alarm(2) and
sleep() is a bad idea.
Using longjmp(3) from a signal handler or modifying the handling of
SIGALRM while sleeping will cause undefined results.
SEE ALSO
alarm(2), nanosleep(2), signal(2), signal(7)
COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
我的答案行吗?请采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
最好去下载C/C++专门使用的查找手册,也就是我们常说的API,里面包含了一些Windows
API。点击里面的头文件即可找到函数。MSDN只是专门给微软用户提供的。
API。点击里面的头文件即可找到函数。MSDN只是专门给微软用户提供的。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询