📄 ansistdlib.html
字号:
unspecified.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>stdlib.h</b><p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ansiStdlib.html#top">ansiStdlib</a></b><hr><a name="rand"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>rand</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>rand</i>( )</strong> - generate a pseudo-random integer between 0 and <b>RAND_MAX</b> (ANSI)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int rand (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine generates a pseudo-random integer between 0 and <b>RAND_MAX</b>.The seed value for <b><i><a href="./ansiStdlib.html#rand">rand</a></i>( )</b> can be reset with <b><i><a href="./ansiStdlib.html#srand">srand</a></i>( )</b>.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>stdlib.h</b> <p></blockquote><h4>RETURNS</h4><blockquote><p>A pseudo-random integer.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ansiStdlib.html#top">ansiStdlib</a></b>, <b><i><a href="./ansiStdlib.html#srand">srand</a></i>( )</b><hr><a name="srand"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>srand</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>srand</i>( )</strong> - reset the value of the seed used to generate random numbers (ANSI)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void * srand ( uint_t seed /* random number seed */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine resets the seed value used by <b><i><a href="./ansiStdlib.html#rand">rand</a></i>( )</b>. If <b><i><a href="./ansiStdlib.html#srand">srand</a></i>( )</b> is thencalled with the same seed value, the sequence of pseudo-random numbers isrepeated. If <b><i><a href="./ansiStdlib.html#rand">rand</a></i>( )</b> is called before any calls to <b><i><a href="./ansiStdlib.html#srand">srand</a></i>( )</b> have been made,the same sequence shall be generated as when <b><i><a href="./ansiStdlib.html#srand">srand</a></i>( )</b> is first called withthe seed value of 1.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>stdlib.h</b> <p></blockquote><h4>RETURNS</h4><blockquote><p>N/A<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ansiStdlib.html#top">ansiStdlib</a></b>, <b><i><a href="./ansiStdlib.html#rand">rand</a></i>( )</b><hr><a name="strtod"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>strtod</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>strtod</i>( )</strong> - convert the initial portion of a string to a double (ANSI) </p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>double strtod ( const char * s, /* string to convert */ char * * endptr /* ptr to final string */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine converts the initial portion of a specified string <i>s</i> to adouble. First, it decomposes the input string into three parts: an initial, possibly empty, sequence of white-space characters (as specified by the <b><i><a href="./ansiCtype.html#isspace">isspace</a></i>( )</b> function); a subject sequence resembling a floating-pointconstant; and a final string of one or more unrecognized characters, including the terminating null character of the input string. Then, itattempts to convert the subject sequence to a floating-point number, and returns the result.<p>The expected form of the subject sequence is an optional plus or minusdecimal-point character, then an optional exponent part but no floatingsuffix. The subject sequence is defined as the longest initialsubsequence of the input string, starting with the first non-white-spacecharacter, that is of the expected form. The subject sequence containsno characters if the input string is empty or consists entirely of white space, or if the first non-white-space character is other than a sign, a digit, or a decimal-point character.<p>If the subject sequence has the expected form, the sequence of charactersstarting with the first digit or the decimal-point character (whicheveroccurs first) is interpreted as a floating constant, except that the decimal-point character is used in place of a period, and that if neitheran exponent part nor a decimal-point character appears, a decimal point isassumed to follow the last digit in the string. If the subject sequencebegins with a minus sign, the value resulting form the conversion is negated.A pointer to the final string is stored in the object pointed to by <i>endptr</i>,provided that <i>endptr</i> is not a null pointer.<p>In other than the "C" locale, additional implementation-defined subjectsequence forms may be accepted. VxWorks supports only the "C" locale.<p>If the subject sequence is empty or does not have the expected form, noconversion is performed; the value of <i>s</i> is stored in the object pointedto by <i>endptr</i>, provided that <i>endptr</i> is not a null pointer.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>stdlib.h</b> <p></blockquote><h4>RETURNS</h4><blockquote><p><p>The converted value, if any. If no conversion could be performed, itreturns zero. If the correct value is outside the range of representablevalues, it returns plus or minus <b>HUGE_VAL</b> (according to the sign of thevalue), and stores the value of the macro ERANGE in <b>errno</b>. If thecorrect value would cause underflow, it returns zero and stores the valueof the macro ERANGE in <b>errno</b>.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ansiStdlib.html#top">ansiStdlib</a></b><hr><a name="strtol"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>strtol</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>strtol</i>( )</strong> - convert a string to a long integer (ANSI)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>long strtol ( const char * nptr, /* string to convert */ char * * endptr, /* ptr to final string */ int base /* radix */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine converts the initial portion of a string <i>nptr</i> to <b>long int</b>representation. First, it decomposes the input string into three parts:an initial, possibly empty, sequence of white-space characters (asspecified by <b><i><a href="./ansiCtype.html#isspace">isspace</a></i>( )</b>); a subject sequence resembling an integerrepresented in some radix determined by the value of <i>base</i>; and a finalstring of one or more unrecognized characters, including the terminatingNULL character of the input string. Then, it attempts to convert thesubject sequence to an integer number, and returns the result.<p>If the value of <i>base</i> is zero, the expected form of the subject sequenceis that of an integer constant, optionally preceded by a plus or minussign, but not including an integer suffix. If the value of <i>base</i> isbetween 2 and 36, the expected form of the subject sequence is a sequenceof letters and digits representing an integer with the radix specified by<i>base</i> optionally preceded by a plus or minus sign, but not including aninteger suffix. The letters from a (or A) through to z (or Z) areascribed the values 10 to 35; only letters whose ascribed values are lessthan <i>base</i> are premitted. If the value of <i>base</i> is 16, the characters0x or 0X may optionally precede the sequence of letters and digits,following the sign if present.<p>The subject sequence is defined as the longest initial subsequence of the input string, starting with the first non-white-space character, that is of the expected form. The subject sequence contains no characters if the input string is empty or consists entirely of white space, or if the firstnon-white-space character is other than a sign or a permissible letter ordigit.<p>If the subject sequence has the expected form and the value of <i>base</i> iszero, the sequence of characters starting with the first digit isinterpreted as an integer constant. If the subject sequence has theexpected form and the value of <i>base</i> is between 2 and 36, it is used asthe <i>base</i> for conversion, ascribing to each latter its value as givenabove. If the subject sequence begins with a minus sign, the valueresulting from the conversion is negated. A pointer to the final stringis stored in the object pointed to by <i>endptr</i>, provided that <i>endptr</i> isnot a NULL pointer.<p>In other than the "C" locale, additional implementation-defined subjectsequence forms may be accepted. VxWorks supports only the "C" locale;it assumes that the upper- and lower-case alphabets and digits areeach contiguous.<p>If the subject sequence is empty or does not have the expected form, noconversion is performed; the value of <i>nptr</i> is stored in the objectpointed to by <i>endptr</i>, provided that <i>endptr</i> is not a NULL pointer.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>stdlib.h</b> <p></blockquote><h4>RETURNS</h4><blockquote><p><p>The converted value, if any. If no conversion could be performed, itreturns zero. If the correct value is outside the range of representablevalues, it returns <b>LONG_MAX</b> or <b>LONG_MIN</b> (according to the sign of thevalue), and stores the value of the macro ERANGE in <b>errno</b>.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ansiStdlib.html#top">ansiStdlib</a></b><hr><a name="strtoul"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>strtoul</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>strtoul</i>( )</strong> - convert a string to an unsigned long integer (ANSI)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>ulong_t strtoul ( const char * nptr, /* string to convert */ char * * endptr, /* ptr to final string */ int base /* radix */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine converts the initial portion of a string <i>nptr</i> to<b>unsigned long int</b> representation. First, it decomposes the inputstring into three parts: an initial, possibly empty, sequence ofwhite-space characters (as specified by <b><i><a href="./ansiCtype.html#isspace">isspace</a></i>( )</b>); a subject sequenceresembling an unsigned integer represented in some radix determined bythe value <i>base</i>; and a final string of one or more unrecognizedcharacters, including the terminating null character of the input string.Then, it attempts to convert the subject sequence to an unsigned integer,and returns the result.<p>If the value of <i>base</i> is zero, the expected form of the subject sequenceis that of an integer constant, optionally preceded by a plus or minussign, but not including an integer suffix. If the value of <i>base</i> isbetween 2 and 36, the expected form of the subject sequence is a sequenceof letters and digits representing an integer with the radix specified byletters from a (or A) through z (or Z) which are ascribed the values 10 to35; only letters whose ascribed values are less than <i>base</i> arepremitted. If the value of <i>base</i> is 16, the characters 0x or 0X mayoptionally precede the sequence of letters and digits, following the signif present.<p>The subject sequence is defined as the longest initial subsequence of theinput string, starting with the first non-white-space character, that isof the expected form. The subject sequence contains no characters if theinput string is empty or consists entirely of white space, or if the firstnon-white-space character is other than a sign or a permissible letter ordigit.<p>If the subject sequence has the expected form and the value of <i>base</i> iszero, the sequence of characters starting with the first digit isinterpreted as an integer constant. If the subject sequence has theexpected form and the value of <i>base</i> is between 2 and 36, it is used asthe <i>base</i> for conversion, ascribing to each letter its value as givenabove. If the subject sequence begins with a minus sign, the valueresulting from the conversion is negated. A pointer to the final stringis stored in the object pointed to by <i>endptr</i>, provided that <i>endptr</i> isnot a null pointer.<p>In other than the "C" locale, additional implementation-defined subjectsequence forms may be accepted. VxWorks supports only the "C" locale;it assumes that the upper- and lower-case alphabets and digits areeach contiguous.<p>If the subject sequence is empty or does not have the expected form, noconversion is performed; the value of <i>nptr</i> is stored in the objectpointed to by <i>endptr</i>, provided that <i>endptr</i> is not a null pointer.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>stdlib.h</b> <p></blockquote><h4>RETURNS</h4><blockquote><p><p>The converted value, if any. If no conversion could be performed itreturns zero. If the correct value is outside the range of representablevalues, it returns <b>ULONG_MAX</b>, and stores the value of the macro ERANGE in<i>errno</i>.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ansiStdlib.html#top">ansiStdlib</a></b><hr><a name="system"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>system</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>system</i>( )</strong> - pass a string to a command processor (Unimplemented) (ANSI)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int system ( const char * string /* pointer to string */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function is not applicable to VxWorks.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>stdlib.h</b> <p></blockquote><h4>RETURNS</h4><blockquote><p>OK, always.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ansiStdlib.html#top">ansiStdlib</a></b></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -