<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="https://code-reference.com/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://code-reference.com/feed.php">
        <title>Programming | Library | Reference - Code-Reference.com c:stdlib.h</title>
        <description></description>
        <link>https://code-reference.com/</link>
        <image rdf:resource="https://code-reference.com/ttps://code-reference.com/lib/tpl/dokuwiki/images/favicon.ico" />
       <dc:date>2026-06-21T05:28:29+02:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/abort?rev=1708041892&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/abs?rev=1708041889&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/atexit?rev=1708041890&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/atof?rev=1708041888&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/atoi?rev=1708041891&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/atol?rev=1708041891&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/bsearch?rev=1708041888&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/calloc?rev=1708041889&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/div?rev=1708041889&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/div_t?rev=1708041889&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/exit?rev=1708041892&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/free?rev=1413084164&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/getenv?rev=1708041890&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/itoa?rev=1708041889&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/labs?rev=1708041890&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/ldiv?rev=1708041890&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/ldiv_t?rev=1708041891&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/ltoa?rev=1708041891&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/malloc?rev=1708041892&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/mb_cur_max?rev=1708041889&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/mblen?rev=1708041890&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/mbstowcs?rev=1708041891&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/mbtowc?rev=1403877396&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/qsort?rev=1708041892&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/rand?rev=1708041889&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/rand_max?rev=1708041892&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/realloc?rev=1708041890&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/sizeof?rev=1708041890&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/srand?rev=1708041890&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/strtod?rev=1708041892&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/strtol?rev=1708041889&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/strtoul?rev=1708041891&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/system?rev=1708041889&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/wcstombs?rev=1708041888&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/stdlib.h/wctomb?rev=1708041891&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://code-reference.com/ttps://code-reference.com/lib/tpl/dokuwiki/images/favicon.ico">
        <title>Programming | Library | Reference - Code-Reference.com</title>
        <link>https://code-reference.com/</link>
        <url>https://code-reference.com/ttps://code-reference.com/lib/tpl/dokuwiki/images/favicon.ico</url>
    </image>
    <item rdf:about="https://code-reference.com/c/stdlib.h/abort?rev=1708041892&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:52+02:00</dc:date>
        <title>abort</title>
        <link>https://code-reference.com/c/stdlib.h/abort?rev=1708041892&amp;do=diff</link>
        <description>abort


    #include &lt;stdlib.h&gt;
    void abort(void);


Cause abnormal program termination, and try to catch SIGABRT. 

no return value

C Sourcecode Example


#include &lt;stdio.h&gt; /* including standard library */
//#include &lt;windows.h&gt; /* uncomment this for Windows */
 /* for printf */
#include &lt;stdlib.h&gt;
int main( void )
{
  int x=2,y=5,i;
  i=x+y;
  
  printf(&quot;x = %i | y = %i\n&quot;, x, y);
  
  abort();
   
  /* will never execute, abort will terminate the programm */
  printf(&quot;result of %i+%i= %i…</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/abs?rev=1708041889&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:49+02:00</dc:date>
        <title>abs</title>
        <link>https://code-reference.com/c/stdlib.h/abs?rev=1708041889&amp;do=diff</link>
        <description>#include &lt;stdlib.h&gt;
    int abs(int i);


computes the absolute value of the integer i 

C Sourcecode Example


#include &lt;stdio.h&gt; /* including standard library */
//#include &lt;windows.h&gt; /* uncomment this for Windows */
 /* for printf */
#include &lt;stdlib.h&gt;
 
int main( void )
{
  int i = -42;
  printf(&quot;abs from i = %d\n&quot;, abs(i));
  return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/atexit?rev=1708041890&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:50+02:00</dc:date>
        <title>atexit</title>
        <link>https://code-reference.com/c/stdlib.h/atexit?rev=1708041890&amp;do=diff</link>
        <description>#include &lt;stdlib.h&gt;
    int atexit(void (*func)(void));
 

Description


       The atexit function registers the given function to be called at normal
       process termination
       
       atexit returns the value 0 if successful, otherwise it returns
       a nonzero value.</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/atof?rev=1708041888&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:48+02:00</dc:date>
        <title>atof</title>
        <link>https://code-reference.com/c/stdlib.h/atof?rev=1708041888&amp;do=diff</link>
        <description>atof


    #include &lt;stdlib.h&gt;
    double atof(const char *str);


Description


       The atof() function converts the initial portion of the string pointed to by
       nptr to double.  The behavior is the same as

           strtod(nptr, (char **) NULL);

       except that atof() does not detect errors.</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/atoi?rev=1708041891&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:51+02:00</dc:date>
        <title>atoi</title>
        <link>https://code-reference.com/c/stdlib.h/atoi?rev=1708041891&amp;do=diff</link>
        <description>#include &lt;stdlib.h&gt;
    int atoi(const char *str);


    convert a string to integer

C Sourcecode Example


#include &lt;stdio.h&gt; /* including standard library */
//#include &lt;windows.h&gt; /* uncomment this for Windows */

#include &lt;stdlib.h&gt;

int main(void){

    char string[]=&quot;1234&quot;;
    int  i;
    
printf(&quot;string = %s \n&quot;, string );
printf(&quot;int = %i \n&quot;, atoi(string) );

i = atoi(string);
i = i + i;
printf(&quot;i + i = %i\n&quot;, i);

return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/atol?rev=1708041891&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:51+02:00</dc:date>
        <title>atol</title>
        <link>https://code-reference.com/c/stdlib.h/atol?rev=1708041891&amp;do=diff</link>
        <description>#include &lt;stdlib.h&gt;
     long int atol(const char *str); 


    convert a string to long integer

C Sourcecode Example


#include &lt;stdio.h&gt; /* including standard library */
//#include &lt;windows.h&gt; /* uncomment this for Windows */

#include &lt;stdlib.h&gt;

int main(void){

    char string[]=&quot;1234&quot;;
    long int  i;
    
printf(&quot;string = %s \n&quot;, string );
printf(&quot;int = %li \n&quot;, atol(string) );

i = atol(string);
i = i + i;
printf(&quot;i + i = %li\n&quot;, i);

return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/bsearch?rev=1708041888&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:48+02:00</dc:date>
        <title>bsearch</title>
        <link>https://code-reference.com/c/stdlib.h/bsearch?rev=1708041888&amp;do=diff</link>
        <description>bsearch


    #include &lt;stdlib.h&gt;
    void *bsearch(const void *key, const void *base, size_t nitems, size_t size, int (*compare)(const void *, const void *));


key     - The element that is searched for

base    - pointer to the first element of the array to be searched

nitems  - number of elements in the array

size    - size of a single element

compare - comparison function to compare two elements together.</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/calloc?rev=1708041889&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:49+02:00</dc:date>
        <title>calloc</title>
        <link>https://code-reference.com/c/stdlib.h/calloc?rev=1708041889&amp;do=diff</link>
        <description>#include &lt;stdlib.h&gt;
    void *calloc(size_t nitems, size_t size); 


description

The calloc() function shall allocate unused space for an array of nelem elements each of whose size in bytes is elsize. 

The space shall be initialized to all bits 0.



The order and contiguity of storage allocated by successive calls to calloc() is unspecified. 

The pointer returned if the allocation succeeds shall be suitably aligned so that it may be assigned to a 

pointer to any type of object and then used…</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/div?rev=1708041889&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:49+02:00</dc:date>
        <title>div</title>
        <link>https://code-reference.com/c/stdlib.h/div?rev=1708041889&amp;do=diff</link>
        <description>#include &lt;stdlib.h&gt;
    div_t div(int numerator, int denominator);


    calculates the quotient and remainder from division.

div C Sourcecode Example


/* 
 * div c example code
 * http://code-reference.com/c/stdlib.h/div 
 */
#include &lt;stdio.h&gt; /* including standard library */
//#include &lt;windows.h&gt; /* uncomment this for Windows */

#include &lt;stdlib.h&gt;

int main( void )
{
  int numerator, denominator;
  printf(&quot;please type in numerator and denominator for div\n&quot;);
  printf(&quot;numerator :&quot;);
  s…</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/div_t?rev=1708041889&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:49+02:00</dc:date>
        <title>div_t</title>
        <link>https://code-reference.com/c/stdlib.h/div_t?rev=1708041889&amp;do=diff</link>
        <description>div_t

Structure returned by div

Structure used to represent the value of an integral division performed by div.



It has two members of the same type, defined in either order as:

int quot;

int rem;</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/exit?rev=1708041892&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:52+02:00</dc:date>
        <title>exit</title>
        <link>https://code-reference.com/c/stdlib.h/exit?rev=1708041892&amp;do=diff</link>
        <description>#include &lt;stdlib.h&gt;
    void exit(int status);


exit causes the termination of a program.

To the environment in which the program was started, a return code will be sent.


exit C Sourcecode Example


/* 
 * exit c example code
 * http://code-reference.com/c/stdlib.h/exit 
 */
#include &lt;stdio.h&gt; /* including standard library */
//#include &lt;windows.h&gt; /* uncomment this for Windows */

#include &lt;stdlib.h&gt;

int exittest ( int testval )
{
   if (testval == 3 ) {  exit (1); }
return 0;
}

int main(…</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/free?rev=1413084164&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2014-10-12T05:22:44+02:00</dc:date>
        <title>free</title>
        <link>https://code-reference.com/c/stdlib.h/free?rev=1413084164&amp;do=diff</link>
        <description>#include &lt;stdlib.h&gt;
    void free(void *ptr);


description

The free() function shall cause the space pointed to by ptr to be deallocated; that is, made available for further allocation.

If ptr is a null pointer, no action shall occur. Otherwise, if the argument does not match a pointer earlier returned by 

the calloc(), malloc(), posix_memalign(), realloc(), or strdup() function, or if the space has been deallocated by a call

to free() or realloc(), the behavior is undefined.



Any use of …</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/getenv?rev=1708041890&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:50+02:00</dc:date>
        <title>getenv</title>
        <link>https://code-reference.com/c/stdlib.h/getenv?rev=1708041890&amp;do=diff</link>
        <description>#include &lt;stdlib.h&gt;
    char *getenv(const char *name);


getenv matches the string pointed to by name


returns a pointer to the value in the environment, or NULL if there is no match.


getenv C Sourcecode Example


/* 
 * getenv example code
 * http://code-reference.com/c/stdlib.h/getenv
 */
#include &lt;stdio.h&gt; /* including standard library */
//#include &lt;windows.h&gt; /* uncomment this for Windows */

#include &lt;stdlib.h&gt;

int main ( void )
{
  char *env;
  env = getenv (&quot;USER&quot;);
  if (env!=NULL)…</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/itoa?rev=1708041889&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:49+02:00</dc:date>
        <title>itoa</title>
        <link>https://code-reference.com/c/stdlib.h/itoa?rev=1708041889&amp;do=diff</link>
        <description>description of itoa

itoa is in work by code-reference.com 

if you are faster... don't hasitate and add it


no example at the moment


output of itoa c example
  no example at the moment</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/labs?rev=1708041890&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:50+02:00</dc:date>
        <title>labs</title>
        <link>https://code-reference.com/c/stdlib.h/labs?rev=1708041890&amp;do=diff</link>
        <description>#include &lt;stdlib.h&gt;
    long int labs(long int x);


computes the absolute value of a long integer



returns the absolute value of a number

the case of a negative number the sign is reversed, a positive number is returned unchanged.

labs is functionally equivalent to abs (), but uses the data type long int</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/ldiv?rev=1708041890&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:50+02:00</dc:date>
        <title>ldiv</title>
        <link>https://code-reference.com/c/stdlib.h/ldiv?rev=1708041890&amp;do=diff</link>
        <description>#include &lt;stdlib.h&gt;
    ldiv_t ldiv(long int numerator, long int denominator);


    calculate the quotient and remainder in integer division (long integer).

ldiv C Sourcecode Example


/* 
 * ldiv c example code
 * http://code-reference.com/c/stdlib.h/ldiv 
 */
#include &lt;stdio.h&gt; /* including standard library */
//#include &lt;windows.h&gt; /* uncomment this for Windows */

#include &lt;stdlib.h&gt;

int main( void )
{
  long int numerator, denominator;
  printf(&quot;please type in (long int) numerator and de…</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/ldiv_t?rev=1708041891&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:51+02:00</dc:date>
        <title>ldiv_t</title>
        <link>https://code-reference.com/c/stdlib.h/ldiv_t?rev=1708041891&amp;do=diff</link>
        <description>Structure used to represent the value of an integral division performed by div or ldiv.



It has two members of the same type, defined in either order as:

long quot;

long rem;</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/ltoa?rev=1708041891&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:51+02:00</dc:date>
        <title>ltoa</title>
        <link>https://code-reference.com/c/stdlib.h/ltoa?rev=1708041891&amp;do=diff</link>
        <description>description of ltoa

ltoa is in work by code-reference.com 

if you are faster... don't hasitate and add it


no example at the moment


output of ltoa c example
  no example at the moment</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/malloc?rev=1708041892&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:52+02:00</dc:date>
        <title>malloc</title>
        <link>https://code-reference.com/c/stdlib.h/malloc?rev=1708041892&amp;do=diff</link>
        <description>#include &lt;stdlib.h&gt;
    void *malloc(size_t size);


description

The malloc() function shall allocate unused space for an object whose size in bytes is specified by size and whose value is unspecified.



The order and contiguity of storage allocated by successive calls to malloc() is unspecified.

The pointer returned if the allocation succeeds shall be suitably aligned so that it may be assigned to a pointer 

to any type of object and then used to access such an object in the space allocated…</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/mb_cur_max?rev=1708041889&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:49+02:00</dc:date>
        <title>MB_CUR_MAX</title>
        <link>https://code-reference.com/c/stdlib.h/mb_cur_max?rev=1708041889&amp;do=diff</link>
        <description>MB_CUR_MAX




#define MB_CUR_MAX &lt;rvalue integer expression &gt;= 1&gt;

The macro yields the maximum number of characters that constitute a multibyte character in the current locale. Its value is &lt;= MB_LEN_MAX.</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/mblen?rev=1708041890&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:50+02:00</dc:date>
        <title>mblen</title>
        <link>https://code-reference.com/c/stdlib.h/mblen?rev=1708041890&amp;do=diff</link>
        <description>#include &lt;stdlib.h&gt;
    int mblen(const char *str, size_t n); 
 

Description

Determines how many bytes are used for a character.
  &lt;setlocale.h&gt; is for this example nessesary 
mblen C Sourcecode Example 1


/* 
 * mblen example code
 * http://code-reference.com/c/stdlib.h/mblen 
 */

#include &lt;stdio.h&gt; /* including standard library */
//#include &lt;windows.h&gt; /* uncomment this for Windows */
#include &lt;stdlib.h&gt;
#include &lt;locale.h&gt; /* for setlocale */

int main(void)
{
   setlocale(LC_ALL,&quot;&quot;); 
 …</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/mbstowcs?rev=1708041891&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:51+02:00</dc:date>
        <title>mbstowcs</title>
        <link>https://code-reference.com/c/stdlib.h/mbstowcs?rev=1708041891&amp;do=diff</link>
        <description>mbstowcs


    #include &lt;stdlib.h&gt;
    size_t mbstowcs(schar_t *pwcs, const char *str, size_t n);
 

Description

mbstowcs converts multibyte characters to wide characters

mbstowcs c sourcecode example


/* 
 * mbstowcs example code
 * http://code-reference.com/c/stdlib.h/mbstowcs 
 */
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;

int main( void )
{
    char      mbinput[8] =  &quot;\x54\x65\x73\x74\x20\x31\x32&quot;;
    wchar_t   output[8];
    size_t    wcssize;

    wcssize = mbstowcs(output, mbinput, 8);
…</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/mbtowc?rev=1403877396&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2014-06-27T15:56:36+02:00</dc:date>
        <title>mbtowc</title>
        <link>https://code-reference.com/c/stdlib.h/mbtowc?rev=1403877396&amp;do=diff</link>
        <description>mbtowc


    #include &lt;stdlib.h&gt;
        int mbtowc(whcar_t *pwc, const char *str, size_t n);
 

Description

converts a multibyte character into a wide character.
  &lt;setlocale.h&gt; &lt;wchar.h&gt; is for this example nessesary
mbtowc C Sourcecode Example


/* 
 * mbtowc example code
 * http://code-reference.com/c/stdlib.h/mbtowc 
 */
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt; 
#include &lt;wchar.h&gt; /*  wint_t*/
#include &lt;locale.h&gt; /* setlocale*/

int main(void)
{
  wchar_t wchar;
  char string[] = &quot;mbtowc: 測試…</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/qsort?rev=1708041892&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:52+02:00</dc:date>
        <title>qsort</title>
        <link>https://code-reference.com/c/stdlib.h/qsort?rev=1708041892&amp;do=diff</link>
        <description>#include &lt;stdlib.h&gt;
    void qsort(void *base, size_t nitems, size_t size, int (*compar)(const void *, const void*));


Description

base   = Pointer to elements

nitems = Number of elements

size = Size of one element

compar = Pointer to comparison function</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/rand?rev=1708041889&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:49+02:00</dc:date>
        <title>rand</title>
        <link>https://code-reference.com/c/stdlib.h/rand?rev=1708041889&amp;do=diff</link>
        <description>#include &lt;stdlib.h&gt;
    int rand(void);


Description

Generates a random Number

  &lt;time.h&gt; is for this example nessesary
rand C Sourcecode Example 1


/* 
 * rand example code
 * http://code-reference.com/c/stdlib.h/rand 
 */
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;time.h&gt; /* for srand salt */

int main ( void )
{

  int i;
  /* initialize random generator */
  /* without srand, rand will generate only once random numbers */
  srand ( time(NULL) ); /* comment it out to see what happen…</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/rand_max?rev=1708041892&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:52+02:00</dc:date>
        <title>RAND_MAX</title>
        <link>https://code-reference.com/c/stdlib.h/rand_max?rev=1708041892&amp;do=diff</link>
        <description>#define RAND_MAX &lt;integer constant expression &gt;= 32,767&gt;

The macro yields the maximum value returned by rand.</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/realloc?rev=1708041890&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:50+02:00</dc:date>
        <title>realloc</title>
        <link>https://code-reference.com/c/stdlib.h/realloc?rev=1708041890&amp;do=diff</link>
        <description>realloc


    #include &lt;stdlib.h&gt;
    void *realloc(void *ptr, size_t size); 


description

The realloc() function shall change the size of the memory object pointed to by ptr to the size specified by size. 

The contents of the object shall remain unchanged up to the lesser of the new and old sizes. 

If the new size of the memory object would require movement of the object, the space for the previous instantiation of the object is freed.

If the new size is larger, the contents of the newly a…</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/sizeof?rev=1708041890&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:50+02:00</dc:date>
        <title>sizeof</title>
        <link>https://code-reference.com/c/stdlib.h/sizeof?rev=1708041890&amp;do=diff</link>
        <description>“New”

sizeof


#include &lt;stdlib.h&gt;

    int sizeof(VALUE);


    sizeof operator returns the number of bytes to be reserved for a variable or a data type.

C Sourcecode Example


#include &lt;stdio.h&gt; /* including standard library */
#include &lt;stdlib.h&gt;
//#include &lt;windows.h&gt; /* uncomment this for Windows */


int main(void){

printf(&quot;int:         %d bytes\n&quot;, sizeof(int) );
printf(&quot;Hello World: %d bytes\n&quot;, sizeof(&quot;Hello World&quot;) );

return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/srand?rev=1708041890&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:50+02:00</dc:date>
        <title>srand</title>
        <link>https://code-reference.com/c/stdlib.h/srand?rev=1708041890&amp;do=diff</link>
        <description>srand


    #include &lt;stdlib.h&gt;
    void srand(unsigned int seed);


Description

srand is used to initialize the random number generator.

The use of date / time to initialize the generator 

means that the generated sequence of numbers “random” is.</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/strtod?rev=1708041892&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:52+02:00</dc:date>
        <title>strtod</title>
        <link>https://code-reference.com/c/stdlib.h/strtod?rev=1708041892&amp;do=diff</link>
        <description>strtod


    #include &lt;stdlib.h&gt;
    double strtod(const char *str, char **endptr);


strtod converts a string into a double variable

strtod c code example


/* 
 * strtod example code
 * http://code-reference.com/c/stdlib.h/strtod
 */
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;

int main ( void )
{
  char string[] =&quot;2040 strtod string 5&quot;;
  char *endptr;
  double number;

  number = strtod(string, &amp;endptr);
  printf(&quot;String is %s\n&quot;,string);
  printf(&quot;Double is %f\n&quot;, number);

  return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/strtol?rev=1708041889&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:49+02:00</dc:date>
        <title>strtol</title>
        <link>https://code-reference.com/c/stdlib.h/strtol?rev=1708041889&amp;do=diff</link>
        <description>#include &lt;stdlib.h&gt;
    long int strtol(const char *str, char **endptr, int base);


strtol Converting a string to an long integer

str: the string to be converted

endptr: address of a pointer variable that points to the last character read, so the character that is not owned by a number

base: base between 2 and 36



Be found unprefixed numbers, these numbers in base 10 are accepted.

If the base '0 'is specified, the strings make a reference to the basis used

(leading “0x” for hexadecimal, …</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/strtoul?rev=1708041891&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:51+02:00</dc:date>
        <title>strtoul</title>
        <link>https://code-reference.com/c/stdlib.h/strtoul?rev=1708041891&amp;do=diff</link>
        <description>strtoul


    #include &lt;stdlib.h&gt;
    unsigned long int strtoul(const char *str, char **endptr, int base);


strtoul Converting a string to an unsigned long integer

str: the string to be converted

endptr: address of a pointer variable that points to the last character read, so the character that is not owned by a number

base: base between 2 and 36



Be found unprefixed numbers, these numbers in base 10 are accepted.

If the base '0 'is specified, the strings make a reference to the basis use…</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/system?rev=1708041889&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:49+02:00</dc:date>
        <title>system</title>
        <link>https://code-reference.com/c/stdlib.h/system?rev=1708041889&amp;do=diff</link>
        <description>#include &lt;stdlib.h&gt;
     int system(const char *string);


system calls a command on the shell

system c code example


/* 
 * system example code
 * http://code-reference.com/c/stdlib.h/system
 */
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
 
int main (void)
{
  char * command = &quot;uname -a&quot;;
  
  int cmd = system( command );
 
  if( cmd == -1 ) { printf( &quot;Error while initalize system command.\n&quot;); }
  else if( cmd &gt; 0 )   { printf( &quot;command return value  %d.\n&quot;, cmd ); }
  else  printf( &quot;success\n&quot; )…</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/wcstombs?rev=1708041888&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:48+02:00</dc:date>
        <title>wcstombs</title>
        <link>https://code-reference.com/c/stdlib.h/wcstombs?rev=1708041888&amp;do=diff</link>
        <description>wcstombs


    #include &lt;stdlib.h&gt;
    size_t wcstombs(char *str, const wchar_t *pwcs, size_t n); 
 

Description

wcstombs converts a wide character string into a multibyte character string.

conversion stops after the size n is reached.


The behavior of wcstombs is affected by the LC_CTYPE category of the current locale</description>
    </item>
    <item rdf:about="https://code-reference.com/c/stdlib.h/wctomb?rev=1708041891&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:51+02:00</dc:date>
        <title>wctomb</title>
        <link>https://code-reference.com/c/stdlib.h/wctomb?rev=1708041891&amp;do=diff</link>
        <description>wctomb


    #include &lt;stdlib.h&gt;
    int wctomb(char *str, wchar_t wchar); 
 

Description

wctomb converts a wide character to a multibyte character in the string.

wctomb maximum MB_CUR_MAX sign stores in a string.

The behavior of wctomb is affected by the LC_CTYPE category of the current locale</description>
    </item>
</rdf:RDF>
