You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

пре 3 година
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <title>Strings (The Red Hat newlib C Library)</title>
  7. <meta name="description" content="Strings (The Red Hat newlib C Library)">
  8. <meta name="keywords" content="Strings (The Red Hat newlib C Library)">
  9. <meta name="resource-type" content="document">
  10. <meta name="distribution" content="global">
  11. <meta name="Generator" content="makeinfo">
  12. <link href="index.html#Top" rel="start" title="Top">
  13. <link href="Document-Index.html#Document-Index" rel="index" title="Document Index">
  14. <link href="Document-Index.html#SEC_Contents" rel="contents" title="Table of Contents">
  15. <link href="index.html#Top" rel="up" title="Top">
  16. <link href="bcmp.html#bcmp" rel="next" title="bcmp">
  17. <link href="viscanf.html#viscanf" rel="prev" title="viscanf">
  18. <style type="text/css">
  19. <!--
  20. a.summary-letter {text-decoration: none}
  21. blockquote.indentedblock {margin-right: 0em}
  22. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  23. blockquote.smallquotation {font-size: smaller}
  24. div.display {margin-left: 3.2em}
  25. div.example {margin-left: 3.2em}
  26. div.lisp {margin-left: 3.2em}
  27. div.smalldisplay {margin-left: 3.2em}
  28. div.smallexample {margin-left: 3.2em}
  29. div.smalllisp {margin-left: 3.2em}
  30. kbd {font-style: oblique}
  31. pre.display {font-family: inherit}
  32. pre.format {font-family: inherit}
  33. pre.menu-comment {font-family: serif}
  34. pre.menu-preformatted {font-family: serif}
  35. pre.smalldisplay {font-family: inherit; font-size: smaller}
  36. pre.smallexample {font-size: smaller}
  37. pre.smallformat {font-family: inherit; font-size: smaller}
  38. pre.smalllisp {font-size: smaller}
  39. span.nolinebreak {white-space: nowrap}
  40. span.roman {font-family: initial; font-weight: normal}
  41. span.sansserif {font-family: sans-serif; font-weight: normal}
  42. ul.no-bullet {list-style: none}
  43. -->
  44. </style>
  45. </head>
  46. <body lang="en">
  47. <a name="Strings"></a>
  48. <div class="header">
  49. <p>
  50. Next: <a href="Wchar-strings.html#Wchar-strings" accesskey="n" rel="next">Wchar strings</a>, Previous: <a href="Stdio.html#Stdio" accesskey="p" rel="prev">Stdio</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="Document-Index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Document-Index.html#Document-Index" title="Index" rel="index">Index</a>]</p>
  51. </div>
  52. <hr>
  53. <a name="Strings-and-Memory-_0028string_002eh_0029"></a>
  54. <h2 class="chapter">5 Strings and Memory (<samp>string.h</samp>)</h2>
  55. <p>This chapter describes string-handling functions and functions for
  56. managing areas of memory. The corresponding declarations are in
  57. <samp>string.h</samp>.
  58. </p>
  59. <table class="menu" border="0" cellspacing="0">
  60. <tr><td align="left" valign="top">&bull; <a href="bcmp.html#bcmp" accesskey="1">bcmp</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Compare two memory areas
  61. </td></tr>
  62. <tr><td align="left" valign="top">&bull; <a href="bcopy.html#bcopy" accesskey="2">bcopy</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Copy memory regions
  63. </td></tr>
  64. <tr><td align="left" valign="top">&bull; <a href="bzero.html#bzero" accesskey="3">bzero</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Initialize memory to zero
  65. </td></tr>
  66. <tr><td align="left" valign="top">&bull; <a href="index.html#index" accesskey="4">index</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Search for character in string
  67. </td></tr>
  68. <tr><td align="left" valign="top">&bull; <a href="memccpy.html#memccpy" accesskey="5">memccpy</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Copy memory regions up to end-token
  69. </td></tr>
  70. <tr><td align="left" valign="top">&bull; <a href="memchr.html#memchr" accesskey="6">memchr</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Find character in memory
  71. </td></tr>
  72. <tr><td align="left" valign="top">&bull; <a href="memcmp.html#memcmp" accesskey="7">memcmp</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Compare two memory areas
  73. </td></tr>
  74. <tr><td align="left" valign="top">&bull; <a href="memcpy.html#memcpy" accesskey="8">memcpy</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Copy memory regions
  75. </td></tr>
  76. <tr><td align="left" valign="top">&bull; <a href="memmem.html#memmem" accesskey="9">memmem</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Find memory segment
  77. </td></tr>
  78. <tr><td align="left" valign="top">&bull; <a href="memmove.html#memmove">memmove</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Move possibly overlapping memory
  79. </td></tr>
  80. <tr><td align="left" valign="top">&bull; <a href="mempcpy.html#mempcpy">mempcpy</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Copy memory regions and locate end
  81. </td></tr>
  82. <tr><td align="left" valign="top">&bull; <a href="memrchr.html#memrchr">memrchr</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Reverse search for character in memory
  83. </td></tr>
  84. <tr><td align="left" valign="top">&bull; <a href="memset.html#memset">memset</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Set an area of memory
  85. </td></tr>
  86. <tr><td align="left" valign="top">&bull; <a href="rawmemchr.html#rawmemchr">rawmemchr</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Find character in memory
  87. </td></tr>
  88. <tr><td align="left" valign="top">&bull; <a href="rindex.html#rindex">rindex</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Reverse search for character in string
  89. </td></tr>
  90. <tr><td align="left" valign="top">&bull; <a href="stpcpy.html#stpcpy">stpcpy</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Copy string returning a pointer to its end
  91. </td></tr>
  92. <tr><td align="left" valign="top">&bull; <a href="stpncpy.html#stpncpy">stpncpy</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Counted copy string returning a pointer to its end
  93. </td></tr>
  94. <tr><td align="left" valign="top">&bull; <a href="strcasecmp.html#strcasecmp">strcasecmp</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Compare strings ignoring case
  95. </td></tr>
  96. <tr><td align="left" valign="top">&bull; <a href="strcasestr.html#strcasestr">strcasestr</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Find string segment ignoring case
  97. </td></tr>
  98. <tr><td align="left" valign="top">&bull; <a href="strcat.html#strcat">strcat</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Concatenate strings
  99. </td></tr>
  100. <tr><td align="left" valign="top">&bull; <a href="strchr.html#strchr">strchr</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Search for character in string
  101. </td></tr>
  102. <tr><td align="left" valign="top">&bull; <a href="strchrnul.html#strchrnul">strchrnul</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Search for character in string
  103. </td></tr>
  104. <tr><td align="left" valign="top">&bull; <a href="strcmp.html#strcmp">strcmp</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Character string compare
  105. </td></tr>
  106. <tr><td align="left" valign="top">&bull; <a href="strcoll.html#strcoll">strcoll</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Locale-specific character string compare
  107. </td></tr>
  108. <tr><td align="left" valign="top">&bull; <a href="strcpy.html#strcpy">strcpy</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Copy string
  109. </td></tr>
  110. <tr><td align="left" valign="top">&bull; <a href="strcspn.html#strcspn">strcspn</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Count chars not in string
  111. </td></tr>
  112. <tr><td align="left" valign="top">&bull; <a href="strerror.html#strerror">strerror</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Convert error number to string (strerror, strerror_l)
  113. </td></tr>
  114. <tr><td align="left" valign="top">&bull; <a href="strerror_005fr.html#strerror_005fr">strerror_r</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Convert error number to string
  115. </td></tr>
  116. <tr><td align="left" valign="top">&bull; <a href="strlen.html#strlen">strlen</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Character string length
  117. </td></tr>
  118. <tr><td align="left" valign="top">&bull; <a href="strlwr.html#strlwr">strlwr</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Convert string to lowercase
  119. </td></tr>
  120. <tr><td align="left" valign="top">&bull; <a href="strncasecmp.html#strncasecmp">strncasecmp</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Compare strings ignoring case
  121. </td></tr>
  122. <tr><td align="left" valign="top">&bull; <a href="strncat.html#strncat">strncat</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Concatenate strings
  123. </td></tr>
  124. <tr><td align="left" valign="top">&bull; <a href="strncmp.html#strncmp">strncmp</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Character string compare
  125. </td></tr>
  126. <tr><td align="left" valign="top">&bull; <a href="strncpy.html#strncpy">strncpy</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Counted copy string
  127. </td></tr>
  128. <tr><td align="left" valign="top">&bull; <a href="strnstr.html#strnstr">strnstr</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Find string segment
  129. </td></tr>
  130. <tr><td align="left" valign="top">&bull; <a href="strnlen.html#strnlen">strnlen</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Character string length
  131. </td></tr>
  132. <tr><td align="left" valign="top">&bull; <a href="strpbrk.html#strpbrk">strpbrk</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Find chars in string
  133. </td></tr>
  134. <tr><td align="left" valign="top">&bull; <a href="strrchr.html#strrchr">strrchr</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Reverse search for character in string
  135. </td></tr>
  136. <tr><td align="left" valign="top">&bull; <a href="strsignal.html#strsignal">strsignal</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Return signal message string
  137. </td></tr>
  138. <tr><td align="left" valign="top">&bull; <a href="strspn.html#strspn">strspn</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Find initial match
  139. </td></tr>
  140. <tr><td align="left" valign="top">&bull; <a href="strstr.html#strstr">strstr</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Find string segment
  141. </td></tr>
  142. <tr><td align="left" valign="top">&bull; <a href="strtok.html#strtok">strtok</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Get next token from a string
  143. </td></tr>
  144. <tr><td align="left" valign="top">&bull; <a href="strupr.html#strupr">strupr</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Convert string to upper case
  145. </td></tr>
  146. <tr><td align="left" valign="top">&bull; <a href="strverscmp.html#strverscmp">strverscmp</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Compare version strings
  147. </td></tr>
  148. <tr><td align="left" valign="top">&bull; <a href="strxfrm.html#strxfrm">strxfrm</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Transform string
  149. </td></tr>
  150. <tr><td align="left" valign="top">&bull; <a href="swab.html#swab">swab</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Swap adjacent bytes
  151. </td></tr>
  152. <tr><td align="left" valign="top">&bull; <a href="wcscasecmp.html#wcscasecmp">wcscasecmp</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Compare wide character strings ignoring case
  153. </td></tr>
  154. <tr><td align="left" valign="top">&bull; <a href="wcsdup.html#wcsdup">wcsdup</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Wide character string duplicate
  155. </td></tr>
  156. <tr><td align="left" valign="top">&bull; <a href="wcsncasecmp.html#wcsncasecmp">wcsncasecmp</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Compare wide character strings ignoring case
  157. </td></tr>
  158. </table>
  159. <hr>
  160. <div class="header">
  161. <p>
  162. Next: <a href="Wchar-strings.html#Wchar-strings" accesskey="n" rel="next">Wchar strings</a>, Previous: <a href="Stdio.html#Stdio" accesskey="p" rel="prev">Stdio</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="Document-Index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Document-Index.html#Document-Index" title="Index" rel="index">Index</a>]</p>
  163. </div>
  164. </body>
  165. </html>