⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index.html

📁 this is a mirrored site c-faq. thought might need offline
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3O//DTD W3 HTML 2.0//EN"><!-- This collection of hypertext pages is Copyright 1995-2005 by Steve Summit. --><!-- Content from the book "C Programming FAQs: Frequently Asked Questions" --><!-- (Addison-Wesley, 1995, ISBN 0-201-84519-9) is made available here by --><!-- permission of the author and the publisher as a service to the community. --><!-- It is intended to complement the use of the published text --><!-- and is protected by international copyright laws. --><!-- The on-line content may be accessed freely for personal use --><!-- but may not be published or retransmitted without explicit permission. --><!-- --><!-- this page built Sat Dec 24 21:47:46 2005 by faqproc version 2.7 --><!-- from source file lib.sgml dated Fri Nov 23 12:45:55 2001 --><!-- corresponding to FAQ list version 4.0 --><html><!-- Mirrored from c-faq.com/lib/index.html by HTTrack Website Copier/3.x [XR&CO'2008], Sat, 14 Mar 2009 07:55:58 GMT --><head><meta name=GENERATOR content="faqproc"><title>Library Functions</title></head><body bgcolor="#ffffff">&nbsp;<a href="../index-2.html"><img src="../images/buttontop.gif" alt="top/contents"></a><a href="../search.html"><img src="../images/buttonsrch.gif" alt="search"></a><hr><H1>13. Library Functions</H1><p><a href="itoa.html" rel=subdocument>13.1</a>How can I convert numbers to strings(the opposite of <TT>atoi</TT>)?Is there an <TT>itoa</TT> function?</p><p><a href="strncpy.html" rel=subdocument>13.2</a>Why does <TT>strncpy</TT> not alwaysplace a <TT>'\0'</TT> terminatorin the destination string?</p><p><a href="substr.html" rel=subdocument>13.3</a>Does C have anything like the ``substr''(extract substring)routine present in other languages?</p><p><a href="strupper.html" rel=subdocument>13.4</a>How do I convert a string to all upper or lower case?</p><p><a href="toupper.html" rel=subdocument>13.5</a>Whydo some versions of<TT>toupper</TT> act strangely if given an upper-case letter?<br>Why does some code call <TT>islower</TT> before <TT>toupper</TT>?</p><p><a href="strtok.html" rel=subdocument>13.6</a>How can I split up astringintowhitespace-separated fields?<br>How can I duplicate the processby which <TT>main()</TT>is handed <TT>argc</TT> and <TT>argv</TT>?</p><p><a href="regex.html" rel=subdocument>13.7</a>I need some code to doregular expressionandwildcard matching.</p><p><a href="qsort1.html" rel=subdocument>13.8</a>I'm trying to sort an array of strings with <TT>qsort</TT>,using<TT>strcmp</TT>as the comparison function,but it's not working.</p><p><a href="qsort2.html" rel=subdocument>13.9</a>Now I'm trying to sort an array of structureswith <TT>qsort</TT>.My comparison function takes pointers to structures,but the compilercomplainsthat the function isof the wrong type for <TT>qsort</TT>.How can I cast the function pointer to shut off the warning?</p><p><a href="listsort.html" rel=subdocument>13.10</a>How can I sort a linked list?</p><p><a href="extsort.html" rel=subdocument>13.11</a>How can I sort more data than will fit in memory?</p><p><a href="curtime.html" rel=subdocument>13.12</a>How can I get thecurrent dateortime of day in a C program?</p><p><a href="mktime.html" rel=subdocument>13.13</a>I know that the library function <TT>localtime</TT>will convert a <TT>time_t</TT> into a broken-down <TT>struct&nbsp;tm</TT>,and that <TT>ctime</TT>will convert a<TT>time_t</TT> to a printable string.How can Iperform the inverse operations of convertinga <TT>struct&nbsp;tm</TT> or a string into a <TT>time_t</TT>?</p><p><a href="calendar.html" rel=subdocument>13.14</a>How can I addNdays to a date?How can I find the difference between two dates?</p><p><a href="y2k.html" rel=subdocument>13.14b</a>Did C have any Year 2000 problems?</p><p><a href="rand.html" rel=subdocument>13.15</a>I need a random number generator.</p><p><a href="randrange.html" rel=subdocument>13.16</a>How can I get random integers in a certain range?</p><p><a href="srand.html" rel=subdocument>13.17</a>Each time I run my program,I get the same sequence of numbers back from <TT>rand()</TT>.</p><p><a href="notveryrand.html" rel=subdocument>13.18</a>I need a random true/false value,so I'm just taking <TT>rand()&nbsp;%&nbsp;2</TT>,but it's alternating 0, 1, 0, 1, 0...</p><p><a href="shuffle.html" rel=subdocument>13.19</a>How can I return a sequence of random numberswhich don't repeat at all?</p><p><a href="fprand.html" rel=subdocument>13.19b</a>How can I generate floating-point random numbers?</p><p><a href="gaussian.html" rel=subdocument>13.20</a>How can I generate random numbers with anormal orGaussian distribution?</p><p><a href="rand48.html" rel=subdocument>13.21</a>I'm porting this program, and it calls a routine<TT>drand48</TT>,which my library doesn't have.What isit?</p><p><a href="exitvsreturn.html" rel=subdocument>13.22</a>Is <TT>exit(status)</TT> truly equivalentto returning the same <TT>status</TT> from <TT>main</TT>?</p><p><a href="memmove.html" rel=subdocument>13.23</a>What's the difference between<TT>memcpy</TT> and<TT>memmove</TT>?</p><p><a href="oldlibfcns.html" rel=subdocument>13.24</a>I'm trying to port this old program.Why do I get ``undefined external'' errorsfor some library functions?</p><p><a href="extlibs.html" rel=subdocument>13.25</a>Ikeep gettingerrors due to library functions being undefined,but I'm #including allthe right header files.</p><p><a href="libsearch.html" rel=subdocument>13.26</a>I'm still getting errors due to library functions being undefined,even though I'mexplicitlyrequesting the right librarieswhile linking.</p><p><a href="bloat.html" rel=subdocument>13.27</a>Why is my simple program,which hardly does more than print ``Hello, world!''in a window,compiling to such a huge executable(several hundred K)?Should I <TT>#include</TT> fewer header files?</p><p><a href="endundef.html" rel=subdocument>13.28</a>What does it mean when the linker says that <TT>_end</TT> is undefined?</p><p><a href="noprintf.html" rel=subdocument>13.29</a>My compiler is complaining that <TT>printf</TT> is undefined!How can this be?It's the world's most popular C function...</p><hr><p><a href="../index-2.html">top</a></p><p><a href="../questions.html"><img src="../images/buttontop.gif" alt="contents"></a><a href="../search.html"><img src="../images/buttonsrch.gif" alt="search"></a><br><a href="../about.html">about this FAQ list</a>&nbsp;<a href="../eskimo.html">about eskimo</a>&nbsp;<a href="../search.html">search</a>&nbsp;<a href="../feedback.html">feedback</a>&nbsp;<a href="copyright.html">copyright</a><p>Hosted by<a href="http://www.eskimo.com/"><img src="../../www.eskimo.com/img/link/eskitiny.gif" alt="Eskimo North"></a></p></body><!-- Mirrored from c-faq.com/lib/index.html by HTTrack Website Copier/3.x [XR&CO'2008], Sat, 14 Mar 2009 07:56:10 GMT --></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -