当前位置: 技术问答>linux和unix
strncpy未声明?
来源: 互联网 发布时间:2016-08-05
本文导语: ubuntu下安装程序时提示错误: 'strncpy' was not declared in this scope 该如何处置?菜鸟请教 | 建议楼主学会用man啊,可以解决很多问题 ^_^ debian:~# man strncpy STRNCPY(P) ...
ubuntu下安装程序时提示错误:
'strncpy' was not declared in this scope
该如何处置?菜鸟请教
'strncpy' was not declared in this scope
该如何处置?菜鸟请教
|
建议楼主学会用man啊,可以解决很多问题 ^_^
debian:~# man strncpy
STRNCPY(P) POSIX Programmer’s Manual STRNCPY(P)
NAME
strncpy - copy part of a string
SYNOPSIS
#include
char *strncpy(char *restrict s1, const char *restrict s2, size_t n);
DESCRIPTION
The strncpy() function shall copy not more than n bytes (bytes that
follow a null byte are not copied) from the array pointed to by s2 to
the array pointed to by s1. If copying takes place between objects
that overlap, the behavior is undefined.
If the array pointed to by s2 is a string that is shorter than n bytes,
null bytes shall be appended to the copy in the array pointed to by s1,
until n bytes in all are written.
RETURN VALUE
The strncpy() function shall return s1; no return value is reserved to
indicate an error.
这个是我在debian下面的grep结果:
debian:~# grep -n strncpy /usr/include/string.h
87:extern char *strncpy (char *__restrict __dest,
debian:~# man strncpy
STRNCPY(P) POSIX Programmer’s Manual STRNCPY(P)
NAME
strncpy - copy part of a string
SYNOPSIS
#include
char *strncpy(char *restrict s1, const char *restrict s2, size_t n);
DESCRIPTION
The strncpy() function shall copy not more than n bytes (bytes that
follow a null byte are not copied) from the array pointed to by s2 to
the array pointed to by s1. If copying takes place between objects
that overlap, the behavior is undefined.
If the array pointed to by s2 is a string that is shorter than n bytes,
null bytes shall be appended to the copy in the array pointed to by s1,
until n bytes in all are written.
RETURN VALUE
The strncpy() function shall return s1; no return value is reserved to
indicate an error.
这个是我在debian下面的grep结果:
debian:~# grep -n strncpy /usr/include/string.h
87:extern char *strncpy (char *__restrict __dest,
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。