亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? library_5.html

?? Glibc的中文手冊
?? HTML
?? 第 1 頁 / 共 3 頁
字號:
The <CODE>strcat</CODE> function is similar to <CODE>strcpy</CODE>, except that the
characters from <VAR>from</VAR> are concatenated or appended to the end of
<VAR>to</VAR>, instead of overwriting it.  That is, the first character from
<VAR>from</VAR> overwrites the null character marking the end of <VAR>to</VAR>.
<P>
An equivalent definition for <CODE>strcat</CODE> would be:
<P>
<PRE>
char *
strcat (char *to, const char *from)
{
  strcpy (to + strlen (to), from);
  return to;
}
</PRE>
<P>
This function has undefined results if the strings overlap.
<P>
<A NAME="IDX293"></A>
<U>Function:</U> char * <B>strncat</B> <I>(char *<VAR>to</VAR>, const char *<VAR>from</VAR>, size_t <VAR>size</VAR>)</I><P>
This function is like <CODE>strcat</CODE> except that not more than <VAR>size</VAR>
characters from <VAR>from</VAR> are appended to the end of <VAR>to</VAR>.  A
single null character is also always appended to <VAR>to</VAR>, so the total
allocated size of <VAR>to</VAR> must be at least <CODE><VAR>size</VAR> + 1</CODE> bytes
longer than its initial length.
<P>
<PRE>
char *
strncat (char *to, const char *from, size_t size)
{
  strncpy (to + strlen (to), from, size);
  return to;
}
</PRE>
<P>
The behavior of <CODE>strncat</CODE> is undefined if the strings overlap.
<P>
Here is an example showing the use of <CODE>strncpy</CODE> and <CODE>strncat</CODE>.
Notice how, in the call to <CODE>strncat</CODE>, the <VAR>size</VAR> parameter
is computed to avoid overflowing the character array <CODE>buffer</CODE>.
<P>
<PRE>
#include &#60;string.h&#62;
#include &#60;stdio.h&#62;

#define SIZE 10

static char buffer[SIZE];

main ()
{
  strncpy (buffer, "hello", SIZE);
  printf ("%s\n", buffer);
  strncat (buffer, ", world", SIZE - strlen (buffer) - 1);
  printf ("%s\n", buffer);
}
</PRE>
<P>
The output produced by this program looks like:
<P>
<PRE>
hello
hello, wo
</PRE>
<P>
<A NAME="IDX294"></A>
<U>Function:</U> void * <B>bcopy</B> <I>(void *<VAR>from</VAR>, const void *<VAR>to</VAR>, size_t <VAR>size</VAR>)</I><P>
This is a partially obsolete alternative for <CODE>memmove</CODE>, derived from
BSD.  Note that it is not quite equivalent to <CODE>memmove</CODE>, because the
arguments are not in the same order.
<P>
<A NAME="IDX295"></A>
<U>Function:</U> void * <B>bzero</B> <I>(void *<VAR>block</VAR>, size_t <VAR>size</VAR>)</I><P>
This is a partially obsolete alternative for <CODE>memset</CODE>, derived from
BSD.  Note that it is not as general as <CODE>memset</CODE>, because the only
value it can store is zero.
<P>
<A NAME="IDX296"></A>
<A NAME="IDX297"></A>
<A NAME="IDX298"></A>
<A NAME="IDX299"></A>
<A NAME="IDX300"></A>
<H2><A NAME="SEC62" HREF="library_toc.html#SEC62" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC62">String/Array Comparison</A></H2>
<P>
You can use the functions in this section to perform comparisons on the
contents of strings and arrays.  As well as checking for equality, these
functions can also be used as the ordering functions for sorting
operations.  See section <A HREF="library_8.html#SEC86" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_8.html#SEC86">Searching and Sorting</A>, for an example of this.
<P>
Unlike most comparison operations in C, the string comparison functions
return a nonzero value if the strings are <EM>not</EM> equivalent rather
than if they are.  The sign of the value indicates the relative ordering
of the first characters in the strings that are not equivalent:  a
negative value indicates that the first string is "less" than the
second, while a positive value indicates that the first string is 
"greater".
<P>
If you are using these functions only to check for equality, you might
find it makes for a cleaner program to hide them behind a macro
definition, like this:
<P>
<PRE>
#define str_eq(s1,s2)  (!strcmp ((s1),(s2)))
</PRE>
<P>
All of these functions are declared in the header file <TT>`string.h'</TT>.
<A NAME="IDX301"></A>
<P>
<A NAME="IDX302"></A>
<U>Function:</U> int <B>memcmp</B> <I>(const void *<VAR>a1</VAR>, const void *<VAR>a2</VAR>, size_t <VAR>size</VAR>)</I><P>
The function <CODE>memcmp</CODE> compares the <VAR>size</VAR> bytes of memory
beginning at <VAR>a1</VAR> against the <VAR>size</VAR> bytes of memory beginning
at <VAR>a2</VAR>.  The value returned has the same sign as the difference
between the first differing pair of bytes (interpreted as <CODE>unsigned
char</CODE> objects, then promoted to <CODE>int</CODE>).
<P>
If the contents of the two blocks are equal, <CODE>memcmp</CODE> returns
<CODE>0</CODE>.
<P>
On arbitrary arrays, the <CODE>memcmp</CODE> function is mostly useful for
testing equality.  It usually isn't meaningful to do byte-wise ordering
comparisons on arrays of things other than bytes.  For example, a
byte-wise comparison on the bytes that make up floating-point numbers
isn't likely to tell you anything about the relationship between the
values of the floating-point numbers.
<P>
You should also be careful about using <CODE>memcmp</CODE> to compare objects
that can contain "holes", such as the padding inserted into structure
objects to enforce alignment requirements, extra space at the end of
unions, and extra characters at the ends of strings whose length is less
than their allocated size.  The contents of these "holes" are
indeterminate and may cause strange behavior when performing byte-wise
comparisons.  For more predictable results, perform an explicit
component-wise comparison.
<P>
For example, given a structure type definition like:
<P>
<PRE>
struct foo
  {
    unsigned char tag;
    union
      {
        double f;
        long i;
        char *p;
      } value;
  };
</PRE>
<P>
you are better off writing a specialized comparison function to compare
<CODE>struct foo</CODE> objects instead of comparing them with <CODE>memcmp</CODE>.
<P>
<A NAME="IDX303"></A>
<U>Function:</U> int <B>strcmp</B> <I>(const char *<VAR>s1</VAR>, const char *<VAR>s2</VAR>)</I><P>
The <CODE>strcmp</CODE> function compares the string <VAR>s1</VAR> against
<VAR>s2</VAR>, returning a value that has the same sign as the difference
between the first differing pair of characters (interpreted as
<CODE>unsigned char</CODE> objects, then promoted to <CODE>int</CODE>).
<P>
If the two strings are equal, <CODE>strcmp</CODE> returns <CODE>0</CODE>.
<P>
A consequence of the ordering used by <CODE>strcmp</CODE> is that if <VAR>s1</VAR>
is an initial substring of <VAR>s2</VAR>, then <VAR>s1</VAR> is considered to be
"less than" <VAR>s2</VAR>.
<P>
<A NAME="IDX304"></A>
<U>Function:</U> int <B>strcasecmp</B> <I>(const char *<VAR>s1</VAR>, const char *<VAR>s2</VAR>)</I><P>
This function is like <CODE>strcmp</CODE>, except that differences in case
are ignored.
<P>
<CODE>strcasecmp</CODE> is derived from BSD.
<P>
<A NAME="IDX305"></A>
<U>Function:</U> int <B>strncasecmp</B> <I>(const char *<VAR>s1</VAR>, const char *<VAR>s2</VAR>, size_t <VAR>n</VAR>)</I><P>
This function is like <CODE>strncmp</CODE>, except that differences in case
are ignored.
<P>
<CODE>strncasecmp</CODE> is a GNU extension.
<P>
<A NAME="IDX306"></A>
<U>Function:</U> int <B>strncmp</B> <I>(const char *<VAR>s1</VAR>, const char *<VAR>s2</VAR>, size_t <VAR>size</VAR>)</I><P>
This function is the similar to <CODE>strcmp</CODE>, except that no more than
<VAR>size</VAR> characters are compared.  In other words, if the two strings are
the same in their first <VAR>size</VAR> characters, the return value is zero.
<P>
Here are some examples showing the use of <CODE>strcmp</CODE> and <CODE>strncmp</CODE>.
These examples assume the use of the ASCII character set.  (If some
other character set--say, EBCDIC--is used instead, then the glyphs
are associated with different numeric codes, and the return values
and ordering may differ.)
<P>
<PRE>
strcmp ("hello", "hello")
    => 0    /* These two strings are the same. */
strcmp ("hello", "Hello")
    => 32   /* Comparisons are case-sensitive. */
strcmp ("hello", "world")
    => -15  /* The character <CODE>'h'</CODE> comes before <CODE>'w'</CODE>. */
strcmp ("hello", "hello, world")
    => -44  /* Comparing a null character against a comma. */
strncmp ("hello", "hello, world"", 5)
    => 0    /* The initial 5 characters are the same. */
strncmp ("hello, world", "hello, stupid world!!!", 5)
    => 0    /* The initial 5 characters are the same. */
</PRE>
<P>
<A NAME="IDX307"></A>
<U>Function:</U> int <B>bcmp</B> <I>(const void *<VAR>a1</VAR>, const void *<VAR>a2</VAR>, size_t <VAR>size</VAR>)</I><P>
This is an obsolete alias for <CODE>memcmp</CODE>, derived from BSD.
<P>
<H2><A NAME="SEC63" HREF="library_toc.html#SEC63" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC63">Collation Functions</A></H2>
<A NAME="IDX308"></A>
<A NAME="IDX309"></A>
<P>
In some locales, the conventions for lexicographic ordering differ from
the strict numeric ordering of character codes.  For example, in Spanish
most glyphs with diacritical marks such as accents are not considered
distinct letters for the purposes of collation.  On the other hand, the
two-character sequence <SAMP>`ll'</SAMP> is treated as a single letter that is
collated immediately after <SAMP>`l'</SAMP>.
<P>
You can use the functions <CODE>strcoll</CODE> and <CODE>strxfrm</CODE> (declared in
the header file <TT>`string.h'</TT>) to compare strings using a collation
ordering appropriate for the current locale.  The locale used by these
functions in particular can be specified by setting the locale for the
<CODE>LC_COLLATE</CODE> category; see section <A HREF="library_7.html#SEC76" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_7.html#SEC76">Locales and Internationalization</A>.
<A NAME="IDX310"></A>
<P>
In the standard C locale, the collation sequence for <CODE>strcoll</CODE> is
the same as that for <CODE>strcmp</CODE>.
<P>
Effectively, the way these functions work is by applying a mapping to
transform the characters in a string to a byte sequence that represents
the string's position in the collating sequence of the current locale.
Comparing two such byte sequences in a simple fashion is equivalent to
comparing the strings with the locale's collating sequence.
<P>
The function <CODE>strcoll</CODE> performs this translation implicitly, in
order to do one comparison.  By contrast, <CODE>strxfrm</CODE> performs the
mapping explicitly.  If you are making multiple comparisons using the
same string or set of strings, it is likely to be more efficient to use
<CODE>strxfrm</CODE> to transform all the strings just once, and subsequently
compare the transformed strings with <CODE>strcmp</CODE>.
<P>
<A NAME="IDX311"></A>
<U>Function:</U> int <B>strcoll</B> <I>(const char *<VAR>s1</VAR>, const char *<VAR>s2</VAR>)</I><P>
The <CODE>strcoll</CODE> function is similar to <CODE>strcmp</CODE> but uses the
collating sequence of the current locale for collation (the
<CODE>LC_COLLATE</CODE> locale).
<P>
Here is an example of sorting an array of strings, using <CODE>strcoll</CODE>
to compare them.  The actual sort algorithm is not written here; it
comes from <CODE>qsort</CODE> (see section <A HREF="library_8.html#SEC89" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_8.html#SEC89">Array Sort Function</A>).  The job of the
code shown here is to say how to compare the strings while sorting them.
(Later on in this section, we will show a way to do this more
efficiently using <CODE>strxfrm</CODE>.)
<P>
<PRE>
/* This is the comparison function used with <CODE>qsort</CODE>. */

int
compare_elements (char **p1, char **p2)
{
  return strcoll (*p1, *p2);
}

/* This is the entry point--the function to sort
   strings using the locale's collating sequence. */

void
sort_strings (char **array, int nstrings)
{
  /* Sort <CODE>temp_array</CODE> by comparing the strings. */
  qsort (array, sizeof (char *),
         nstrings, compare_elements);
}
</PRE>
<A NAME="IDX312"></A>
<P>
<A NAME="IDX313"></A>
<U>Function:</U> size_t <B>strxfrm</B> <I>(char *<VAR>to</VAR>, const char *<VAR>from</VAR>, size_t <VAR>size</VAR>)</I><P>
The function <CODE>strxfrm</CODE> transforms <VAR>string</VAR> using the collation
transformation determined by the locale currently selected for
collation, and stores the transformed string in the array <VAR>to</VAR>.  Up
to <VAR>size</VAR> characters (including a terminating null character) are
stored.
<P>
The behavior is undefined if the strings <VAR>to</VAR> and <VAR>from</VAR>
overlap; see section <A HREF="library_5.html#SEC61" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_5.html#SEC61">Copying and Concatenation</A>.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品一二三四| 欧美变态口味重另类| 亚洲免费在线电影| av爱爱亚洲一区| 亚洲人成精品久久久久| 日本韩国一区二区三区视频| 亚洲毛片av在线| 欧美日本一区二区| 久久国内精品视频| 国产亚洲短视频| 91影院在线免费观看| 亚洲制服丝袜av| 欧美日韩精品欧美日韩精品一综合| 性久久久久久久久| 精品美女一区二区| 99久久伊人网影院| 天天综合天天做天天综合| 欧美大白屁股肥臀xxxxxx| 国产成人av一区二区| 一区二区三区精品视频在线| 欧美三区免费完整视频在线观看| 久久国产人妖系列| 专区另类欧美日韩| 欧美日韩精品一区二区三区蜜桃 | 国产麻豆视频精品| 欧美国产亚洲另类动漫| 欧美午夜一区二区三区| 国产自产高清不卡| 亚洲永久免费视频| 久久久久97国产精华液好用吗| 91在线码无精品| 国产一区二区三区四区在线观看| ...av二区三区久久精品| 欧美一卡2卡3卡4卡| 成人激情图片网| 美女看a上一区| 亚洲区小说区图片区qvod| 日韩一级黄色大片| 日本高清不卡一区| 国产伦精一区二区三区| 亚洲二区在线观看| 国产精品入口麻豆九色| 日韩美女一区二区三区| 色综合久久久久久久久久久| 久久国产乱子精品免费女| 一区二区三区产品免费精品久久75| 久久综合丝袜日本网| 欧美日本在线一区| 色婷婷亚洲综合| 成人午夜大片免费观看| 久久99精品久久久久久动态图| 亚洲免费观看高清完整| 国产午夜一区二区三区| 日韩免费看网站| 欧美日韩亚州综合| 91天堂素人约啪| 国产宾馆实践打屁股91| 老司机精品视频在线| 午夜欧美电影在线观看| 亚洲精品国产视频| 中文字幕精品一区二区精品绿巨人| 日韩午夜激情电影| 欧美高清激情brazzers| 欧美影视一区在线| 91蜜桃网址入口| 成人免费观看男女羞羞视频| 国产毛片一区二区| 麻豆成人av在线| 免费看欧美美女黄的网站| 午夜国产精品影院在线观看| 一区二区三区日韩欧美| 亚洲精品网站在线观看| 中文字幕日本不卡| 亚洲视频在线观看一区| 中文字幕佐山爱一区二区免费| 中文字幕的久久| 日本一区二区三区四区在线视频| 久久久久国产免费免费| 久久亚洲精华国产精华液 | 色噜噜狠狠成人中文综合| 成人免费看视频| 99九九99九九九视频精品| 成人av网站在线| 91色|porny| 色欧美日韩亚洲| 欧美三电影在线| 9191成人精品久久| 日韩精品一区二区三区四区视频| 日韩三级在线观看| 国产亚洲自拍一区| 国产精品乱人伦中文| 亚洲欧美日韩在线| 一区二区不卡在线视频 午夜欧美不卡在| 亚洲精品国产成人久久av盗摄| 亚洲综合自拍偷拍| 亚洲bdsm女犯bdsm网站| 奇米一区二区三区| 国产乱子伦视频一区二区三区| 成人精品电影在线观看| 成人av免费观看| 色综合久久中文字幕综合网| 欧美高清www午色夜在线视频| 精品国产乱码久久久久久影片| 国产偷国产偷精品高清尤物| 国产精品久久久久久户外露出| 国产精品久久久久久妇女6080| 亚洲一二三区不卡| 六月丁香婷婷久久| 91色.com| 精品成人私密视频| 国产精品乱人伦| 午夜精品福利在线| 高清shemale亚洲人妖| 色乱码一区二区三区88| 4hu四虎永久在线影院成人| 久久久久99精品国产片| 一区二区三区毛片| 国产综合色视频| 一本大道久久a久久精二百| 欧美精品1区2区3区| 中文字幕一区二区三区在线不卡 | 国产亚洲精品久| 五月天一区二区| 成人av电影免费观看| 日韩一区二区影院| 亚洲欧美色综合| 精品一区二区日韩| 欧美日韩中字一区| 中文字幕巨乱亚洲| 经典一区二区三区| 欧美日本一道本| 国产精品国产三级国产普通话蜜臀 | 亚洲 欧美综合在线网络| 国产精品羞羞答答xxdd| 日韩一级免费观看| 亚洲地区一二三色| 色婷婷av一区二区三区gif | 欧美电影免费观看高清完整版| 亚洲欧美另类小说| 成人久久18免费网站麻豆 | 色婷婷一区二区| 国产农村妇女精品| 蜜臀av一区二区三区| 欧洲一区在线观看| 国产精品国产a| 国产成人在线网站| 2欧美一区二区三区在线观看视频| 亚洲一区二区视频在线观看| 不卡一区二区在线| 中文字幕国产一区| 国产精品一二三四五| 亚洲精品一区二区在线观看| 亚洲va欧美va国产va天堂影院| 91同城在线观看| 亚洲天堂免费在线观看视频| 成人久久18免费网站麻豆| 国产人成亚洲第一网站在线播放| 另类调教123区| 日韩精品一区二区三区四区视频| 男女激情视频一区| 欧美一区二区在线免费观看| 一区二区三区丝袜| 欧美色大人视频| 亚洲超碰精品一区二区| 欧美日韩久久久| 秋霞国产午夜精品免费视频| 91精品国产黑色紧身裤美女| 日欧美一区二区| 欧美一区二区性放荡片| 蜜桃av一区二区三区| 欧美tickling网站挠脚心| 精品亚洲成a人| 久久精品欧美一区二区三区麻豆| 国产高清成人在线| 国产精品网站在线观看| www.99精品| 亚洲精品视频在线| 欧美色偷偷大香| 开心九九激情九九欧美日韩精美视频电影| 欧美日韩国产美| 麻豆成人久久精品二区三区红| 欧美一区日韩一区| 国产精一品亚洲二区在线视频| 国产精品久久久一本精品| 97精品电影院| 五月天中文字幕一区二区| 精品久久久久久久人人人人传媒 | 日本中文字幕一区二区有限公司| 欧美精品日韩综合在线| 精品一区在线看| 国产精品欧美综合在线| 色哟哟精品一区| 青青草97国产精品免费观看 | 亚洲天堂网中文字| 欧美亚洲另类激情小说| 久久99精品国产.久久久久 | 欧美变态凌虐bdsm| www.久久久久久久久| 午夜欧美视频在线观看| 国产日韩欧美电影|