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

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

?? library_5.html

?? Glibc的中文手冊
?? HTML
?? 第 1 頁 / 共 3 頁
字號:
<P>
The return value is the length of the entire transformed string.  This
value is not affected by the value of <VAR>size</VAR>, but if it is greater
than <VAR>size</VAR>, it means that the transformed string did not entirely
fit in the array <VAR>to</VAR>.  In this case, only as much of the string as
actually fits was stored.  To get the whole transformed string, call
<CODE>strxfrm</CODE> again with a bigger output array.
<P>
The transformed string may be longer than the original string, and it
may also be shorter.
<P>
If <VAR>size</VAR> is zero, no characters are stored in <VAR>to</VAR>.  In this
case, <CODE>strxfrm</CODE> simply returns the number of characters that would
be the length of the transformed string.  This is useful for determining
what size string to allocate.  It does not matter what <VAR>to</VAR> is if
<VAR>size</VAR> is zero; <VAR>to</VAR> may even be a null pointer.
<P>
Here is an example of how you can use <CODE>strxfrm</CODE> when
you plan to do many comparisons.  It does the same thing as the previous
example, but much faster, because it has to transform each string only
once, no matter how many times it is compared with other strings.  Even
the time needed to allocate and free storage is much less than the time
we save, when there are many strings.
<P>
<PRE>
struct sorter { char *input; char *transformed; };

/* This is the comparison function used with <CODE>qsort</CODE>
   to sort an array of <CODE>struct sorter</CODE>. */

int
compare_elements (struct sorter *p1, struct sorter *p2)
{
  return strcmp (p1-&#62;transformed, p2-&#62;transformed);
}

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

void
sort_strings_fast (char **array, int nstrings)
{
  struct sorter temp_array[nstrings];
  int i;

  /* Set up <CODE>temp_array</CODE>.  Each element contains
     one input string and its transformed string. */
  for (i = 0; i &#60; nstrings; i++)
    {
      size_t length = strlen (array[i]) * 2;

      temp_array[i].input = array[i];

      /* Transform <CODE>array[i]</CODE>.
         First try a buffer probably big enough. */
      while (1)
        {
          char *transformed = (char *) xmalloc (length);
          if (strxfrm (transformed, array[i], length) &#60; length)
            {
              temp_array[i].transformed = transformed;
              break;
            }
          /* Try again with a bigger buffer. */
          free (transformed);
          length *= 2;
        }
    }

  /* Sort <CODE>temp_array</CODE> by comparing transformed strings. */
  qsort (temp_array, sizeof (struct sorter),
         nstrings, compare_elements);

  /* Put the elements back in the permanent array
     in their sorted order. */
  for (i = 0; i &#60; nstrings; i++)
    array[i] = temp_array[i].input;

  /* Free the strings we allocated. */
  for (i = 0; i &#60; nstrings; i++)
    free (temp_array[i].transformed);
}
</PRE>
<P>
<STRONG>Compatibility Note:</STRONG>  The string collation functions are a new
feature of ANSI C.  Older C dialects have no equivalent feature.
<P>
<H2><A NAME="SEC64" HREF="library_toc.html#SEC64" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC64">Search Functions</A></H2>
<P>
This section describes library functions which perform various kinds
of searching operations on strings and arrays.  These functions are
declared in the header file <TT>`string.h'</TT>.
<A NAME="IDX315"></A>
<A NAME="IDX316"></A>
<A NAME="IDX314"></A>
<P>
<A NAME="IDX317"></A>
<U>Function:</U> void * <B>memchr</B> <I>(const void *<VAR>block</VAR>, int <VAR>c</VAR>, size_t <VAR>size</VAR>)</I><P>
This function finds the first occurrence of the byte <VAR>c</VAR> (converted
to an <CODE>unsigned char</CODE>) in the initial <VAR>size</VAR> bytes of the
object beginning at <VAR>block</VAR>.  The return value is a pointer to the
located byte, or a null pointer if no match was found.
<P>
<A NAME="IDX318"></A>
<U>Function:</U> char * <B>strchr</B> <I>(const char *<VAR>string</VAR>, int <VAR>c</VAR>)</I><P>
The <CODE>strchr</CODE> function finds the first occurrence of the character
<VAR>c</VAR> (converted to a <CODE>char</CODE>) in the null-terminated string
beginning at <VAR>string</VAR>.  The return value is a pointer to the located
character, or a null pointer if no match was found.
<P>
For example,
<PRE>
strchr ("hello, world", 'l')
    => "llo, world"
strchr ("hello, world", '?')
    => NULL
</PRE>
<P>
The terminating null character is considered to be part of the string,
so you can use this function get a pointer to the end of a string by
specifying a null character as the value of the <VAR>c</VAR> argument.
<P>
<A NAME="IDX319"></A>
<U>Function:</U> char * <B>strrchr</B> <I>(const char *<VAR>string</VAR>, int <VAR>c</VAR>)</I><P>
The function <CODE>strrchr</CODE> is like <CODE>strchr</CODE>, except that it searches
backwards from the end of the string <VAR>string</VAR> (instead of forwards
from the front).
<P>
For example,
<PRE>
strrchr ("hello, world", 'l')
    => "ld"
</PRE>
<P>
<A NAME="IDX320"></A>
<U>Function:</U> char * <B>strstr</B> <I>(const char *<VAR>haystack</VAR>, const char *<VAR>needle</VAR>)</I><P>
This is like <CODE>strchr</CODE>, except that it searches <VAR>haystack</VAR> for a
substring <VAR>needle</VAR> rather than just a single character.  It
returns a pointer into the string <VAR>haystack</VAR> that is the first
character of the substring, or a null pointer if no match was found.  If
<VAR>needle</VAR> is an empty string, the function returns <VAR>haystack</VAR>.
<P>
For example,
<PRE>
strstr ("hello, world", "l")
    => "llo, world"
strstr ("hello, world", "wo")
    => "world"
</PRE>
<P>
<A NAME="IDX321"></A>
<U>Function:</U> void * <B>memmem</B> <I>(const void *<VAR>needle</VAR>, size_t <VAR>needle_len</VAR>,<BR>const void *<VAR>haystack</VAR>, size_t <VAR>haystack_len</VAR>)</I><P>
This is like <CODE>strstr</CODE>, but <VAR>needle</VAR> and <VAR>haystack</VAR> are byte
arrays rather than null-terminated strings.  <VAR>needle_len</VAR> is the
length of <VAR>needle</VAR> and <VAR>haystack_len</VAR> is the length of
<VAR>haystack</VAR>.<P>
This function is a GNU extension.
<P>
<A NAME="IDX322"></A>
<U>Function:</U> size_t <B>strspn</B> <I>(const char *<VAR>string</VAR>, const char *<VAR>skipset</VAR>)</I><P>
The <CODE>strspn</CODE> ("string span") function returns the length of the
initial substring of <VAR>string</VAR> that consists entirely of characters that
are members of the set specified by the string <VAR>skipset</VAR>.  The order
of the characters in <VAR>skipset</VAR> is not important.
<P>
For example,
<PRE>
strspn ("hello, world", "abcdefghijklmnopqrstuvwxyz")
    => 5
</PRE>
<P>
<A NAME="IDX323"></A>
<U>Function:</U> size_t <B>strcspn</B> <I>(const char *<VAR>string</VAR>, const char *<VAR>stopset</VAR>)</I><P>
The <CODE>strcspn</CODE> ("string complement span") function returns the length
of the initial substring of <VAR>string</VAR> that consists entirely of characters
that are <EM>not</EM> members of the set specified by the string <VAR>stopset</VAR>.
(In other words, it returns the offset of the first character in <VAR>string</VAR>
that is a member of the set <VAR>stopset</VAR>.)
<P>
For example,
<PRE>
strcspn ("hello, world", " \t\n,.;!?")
    => 5
</PRE>
<P>
<A NAME="IDX324"></A>
<U>Function:</U> char * <B>strpbrk</B> <I>(const char *<VAR>string</VAR>, const char *<VAR>stopset</VAR>)</I><P>
The <CODE>strpbrk</CODE> ("string pointer break") function is related to
<CODE>strcspn</CODE>, except that it returns a pointer to the first character
in <VAR>string</VAR> that is a member of the set <VAR>stopset</VAR> instead of the
length of the initial substring.  It returns a null pointer if no such
character from <VAR>stopset</VAR> is found.
<P>
For example,
<P>
<PRE>
strpbrk ("hello, world", " \t\n,.;!?")
    => ", world"
</PRE>
<P>
<H2><A NAME="SEC65" HREF="library_toc.html#SEC65" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC65">Finding Tokens in a String</A></H2>
<P>
<A NAME="IDX325"></A>
<A NAME="IDX326"></A>
<A NAME="IDX327"></A>
<P>
It's fairly common for programs to have a need to do some simple kinds
of lexical analysis and parsing, such as splitting a command string up
into tokens.  You can do this with the <CODE>strtok</CODE> function, declared
in the header file <TT>`string.h'</TT>.
<A NAME="IDX328"></A>
<P>
<A NAME="IDX329"></A>
<U>Function:</U> char * <B>strtok</B> <I>(char *<VAR>newstring</VAR>, const char *<VAR>delimiters</VAR>)</I><P>
A string can be split into tokens by making a series of calls to the
function <CODE>strtok</CODE>.
<P>
The string to be split up is passed as the <VAR>newstring</VAR> argument on
the first call only.  The <CODE>strtok</CODE> function uses this to set up
some internal state information.  Subsequent calls to get additional
tokens from the same string are indicated by passing a null pointer as
the <VAR>newstring</VAR> argument.  Calling <CODE>strtok</CODE> with another
non-null <VAR>newstring</VAR> argument reinitializes the state information.
It is guaranteed that no other library function ever calls <CODE>strtok</CODE>
behind your back (which would mess up this internal state information).
<P>
The <VAR>delimiters</VAR> argument is a string that specifies a set of delimiters
that may surround the token being extracted.  All the initial characters
that are members of this set are discarded.  The first character that is
<EM>not</EM> a member of this set of delimiters marks the beginning of the
next token.  The end of the token is found by looking for the next
character that is a member of the delimiter set.  This character in the
original string <VAR>newstring</VAR> is overwritten by a null character, and the
pointer to the beginning of the token in <VAR>newstring</VAR> is returned.
<P>
On the next call to <CODE>strtok</CODE>, the searching begins at the next
character beyond the one that marked the end of the previous token.
Note that the set of delimiters <VAR>delimiters</VAR> do not have to be the
same on every call in a series of calls to <CODE>strtok</CODE>.
<P>
If the end of the string <VAR>newstring</VAR> is reached, or if the remainder of
string consists only of delimiter characters, <CODE>strtok</CODE> returns
a null pointer.
<P>
<STRONG>Warning:</STRONG> Since <CODE>strtok</CODE> alters the string it is parsing,
you always copy the string to a temporary buffer before parsing it with
<CODE>strtok</CODE>.  If you allow <CODE>strtok</CODE> to modify a string that came
from another part of your program, you are asking for trouble; that
string may be part of a data structure that could be used for other
purposes during the parsing, when alteration by <CODE>strtok</CODE> makes the
data structure temporarily inaccurate.
<P>
The string that you are operating on might even be a constant.  Then
when <CODE>strtok</CODE> tries to modify it, your program will get a fatal
signal for writing in read-only memory.  See section <A HREF="library_21.html#SEC336" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_21.html#SEC336">Program Error Signals</A>.
<P>
This is a special case of a general principle: if a part of a program
does not have as its purpose the modification of a certain data
structure, then it is error-prone to modify the data structure
temporarily.
<P>
The function <CODE>strtok</CODE> is not reentrant.  See section <A HREF="library_21.html#SEC357" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_21.html#SEC357">Signal Handling and Nonreentrant Functions</A>, for
a discussion of where and why reentrancy is important.
<P>
Here is a simple example showing the use of <CODE>strtok</CODE>.
<P>
<PRE>
#include &#60;string.h&#62;
#include &#60;stddef.h&#62;

...

char string[] = "words separated by spaces -- and, punctuation!";
const char delimiters[] = " .,;:!-";
char *token;

...

token = strtok (string, delimiters);  /* token =&#62; "words" */
token = strtok (NULL, delimiters);    /* token =&#62; "separated" */
token = strtok (NULL, delimiters);    /* token =&#62; "by" */
token = strtok (NULL, delimiters);    /* token =&#62; "spaces" */
token = strtok (NULL, delimiters);    /* token =&#62; "and" */
token = strtok (NULL, delimiters);    /* token =&#62; "punctuation" */
token = strtok (NULL, delimiters);    /* token =&#62; NULL */
</PRE>
<P>Go to the <A HREF="library_4.html" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_4.html">previous</A>, <A HREF="library_6.html" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_6.html">next</A> section.<P>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人精品一区二区三区四区| 亚洲第一主播视频| 3d动漫精品啪啪| www.日本不卡| 国内成人自拍视频| 偷窥国产亚洲免费视频 | 一区二区三区日韩| 精品国产网站在线观看| 欧美综合在线视频| 大桥未久av一区二区三区中文| 日韩一区精品视频| 亚洲视频免费在线观看| 久久夜色精品国产欧美乱极品| 欧美日韩国产综合视频在线观看| 99国产精品一区| 高清成人免费视频| 精品一区二区三区视频| 免费观看在线综合| 亚洲成av人综合在线观看| 国产精品理论片| 中文字幕国产一区| 国产无遮挡一区二区三区毛片日本| 7777精品伊人久久久大香线蕉超级流畅| 一本高清dvd不卡在线观看| 国产精品99久久久久久有的能看| 日本不卡一区二区三区高清视频| 亚洲国产欧美日韩另类综合| 成人欧美一区二区三区1314 | 久久久久久久精| 欧美一区二区三区婷婷月色| 欧美系列在线观看| 在线观看视频91| 在线看不卡av| 欧美色倩网站大全免费| 欧美亚洲一区二区在线| 日本韩国一区二区| 日本高清不卡aⅴ免费网站| av亚洲精华国产精华| 粉嫩欧美一区二区三区高清影视 | 亚洲精品成人精品456| 国产精品久久久久7777按摩| 亚洲国产成人自拍| 国产精品女主播av| 亚洲色图在线视频| 尤物在线观看一区| 亚洲一区电影777| 亚洲第一久久影院| 日韩成人免费电影| 久久99精品国产| 东方aⅴ免费观看久久av| 成人国产一区二区三区精品| caoporn国产一区二区| 91麻豆高清视频| 欧美日韩精品三区| 日韩精品一区在线观看| 久久久久久亚洲综合影院红桃| 国产嫩草影院久久久久| 中文字幕一区二区不卡| 亚洲国产色一区| 美女爽到高潮91| 国产成人一区在线| 色综合久久九月婷婷色综合| 欧美三级电影一区| 精品久久久久久久人人人人传媒 | 在线观看视频欧美| 欧美一级久久久| 国产欧美精品区一区二区三区| 亚洲天堂2014| 日本伊人午夜精品| 成人亚洲一区二区一| 欧美无人高清视频在线观看| 日韩午夜激情视频| 国产精品国产自产拍高清av王其 | 久久久久久免费毛片精品| 成人免费一区二区三区在线观看| 一区二区三区视频在线看| 日本欧美大码aⅴ在线播放| 国产精品 欧美精品| 色婷婷久久99综合精品jk白丝| 欧美一级搡bbbb搡bbbb| 国产精品美女久久久久久久久久久 | 91精品国产综合久久蜜臀| 国产亚洲综合在线| 亚洲v日本v欧美v久久精品| 国产制服丝袜一区| 日本精品一级二级| 久久青草国产手机看片福利盒子| 国产精品嫩草99a| 日日夜夜一区二区| 不卡一区在线观看| 精品久久久久久久人人人人传媒| 一区二区三区四区视频精品免费| 精品亚洲成a人| 91国产免费观看| 国产精品亲子伦对白| 亚洲国产高清aⅴ视频| 一区二区三区四区五区视频在线观看 | 99久久精品国产一区| 欧美一区二区日韩一区二区| 中文字幕中文乱码欧美一区二区| 日本亚洲三级在线| 色婷婷av一区二区三区之一色屋| 久久综合狠狠综合久久激情| 亚洲国产精品视频| www.欧美精品一二区| 精品国产一区二区三区久久久蜜月 | 成人午夜大片免费观看| 91精品国产一区二区三区| 亚洲另类一区二区| 成人动漫视频在线| 久久蜜臀中文字幕| 久久99精品久久久久婷婷| 在线不卡一区二区| 亚洲自拍另类综合| 色综合久久久久| 国产精品久久久久婷婷| 免费观看91视频大全| 欧美久久高跟鞋激| 亚洲愉拍自拍另类高清精品| 99久免费精品视频在线观看| 久久久不卡影院| 国产九九视频一区二区三区| 欧美一级专区免费大片| 亚洲成人免费影院| 欧美日韩在线三级| 亚洲欧美日韩在线| 91视频在线观看| 国产精品久久久久久久午夜片| 国产成人免费av在线| 国产亚洲精品超碰| 粗大黑人巨茎大战欧美成人| 久久久国际精品| 国产一区二区在线视频| 26uuuu精品一区二区| 国产一区二区调教| 久久精品视频免费| 成人av免费在线播放| 亚洲欧洲av另类| 色94色欧美sute亚洲线路一ni| 一区二区在线观看免费| 91福利在线看| 石原莉奈在线亚洲二区| 亚洲日本乱码在线观看| 97久久超碰国产精品| 亚洲欧美日本韩国| 欧美三级午夜理伦三级中视频| 亚洲精品老司机| 欧美三日本三级三级在线播放| 五月激情综合色| 欧美成人福利视频| 国产一区二区三区最好精华液| 亚洲国产成人在线| 色综合久久久久久久久久久| 午夜激情一区二区| 日韩精品综合一本久道在线视频| 国产精品自拍在线| **性色生活片久久毛片| 欧美中文字幕久久| 蜜臀久久99精品久久久久久9| 精品日本一线二线三线不卡| 国产盗摄精品一区二区三区在线| 中文字幕av一区二区三区免费看| 成人18精品视频| 香蕉加勒比综合久久| 精品福利av导航| 99国产精品久久| 日韩高清在线观看| 中文字幕第一区综合| 欧美日韩一区二区三区免费看| 奇米一区二区三区| 中文字幕精品一区 | 中日韩免费视频中文字幕| 色综合久久综合中文综合网| 日韩电影在线看| 中文久久乱码一区二区| 欧美色倩网站大全免费| 国产成人啪午夜精品网站男同| 一区二区三区四区激情| 欧美成人官网二区| 欧美亚洲综合一区| 国产精品123| 日一区二区三区| 中文字幕一区二区三区在线播放| 欧美理论在线播放| 高清视频一区二区| 三级欧美韩日大片在线看| 国产欧美日韩另类视频免费观看| 欧美视频一区二区在线观看| 国产一区免费电影| 偷拍日韩校园综合在线| 综合色天天鬼久久鬼色| 日韩美女视频在线| 欧美午夜精品电影| av不卡一区二区三区| 蜜臀精品久久久久久蜜臀| 一区二区三区中文字幕在线观看| 精品国产乱码久久久久久牛牛| 在线视频欧美区| jlzzjlzz欧美大全| 激情欧美日韩一区二区|