C Reference function strtoul()

This function of stdlib will convert a string to an unsigned long integer.

Usage of strtoul():

unsigned long int strtoul ( const char * str, char ** endptr, int base );

Parameters:

C string str interpreting its content as an unsigned integral number of the specified base, which is returned as an unsigned long int value. More »


Posted in C Reference stdlib.h Functions | Comments Off on C Reference function strtoul()


C Reference function atoi() convert a string to an integer

This function of stdlib will convert a string to an integer.

Usage of atoi():

int atoi ( const char * str );

Parameters:

C string str interpreting its content as a integer. White-spaces are discarded until the first non-whitespace character is found.

Return value:

The function returns the converted integral number as an int value, if successful. If no valid conversion could be performed then an zero value is returned. If the value is out of range then INT_MAX or INT_MIN is returned. More »


Posted in C Reference stdlib.h Functions | 15 Comments


C Reference function atof() convert a string to a double

This function of stdlib will convert a string to a double.

Usage of atof():

double atof ( const char * str );

Parameters:

C string str interpreting its content as a floating point number. White-spaces are discarded until the first non-whitespace character is found. A valid floating point number for atof is formed by: plus or minus sign, sequence of digits, decimal point and optional exponent part (character ‘e’ or ‘E’) More »


Posted in C Reference stdlib.h Functions | 1 Comment


C Reference function atol()

This function of stdlib will convert a string to a long integer.

Usage of atol():

long int atol ( const char * str );

Parameters:

C string str interpreting its content as a integer. White-spaces are discarded until the first non-whitespace character is found.

Return value:

More »


Posted in C Reference stdlib.h Functions | Comments Off on C Reference function atol()


C Reference function labs()

This function will return the absolute value of a long integer.

Usage of labs():

long int labs (long int n);

Parameters:

An integer n.

Return value:

More »


Posted in C Reference stdlib.h Functions | Comments Off on C Reference function labs()


C Reference function ldiv()

The integral quotient and remainder of the division of numerator by denominator integer n,d

Usage of ldiv():

ldiv_t ldiv ( long int n, long int d );

Parameters:

n = numerator

d = denominator

Return value:

More »


Posted in C Reference stdlib.h Functions | Comments Off on C Reference function ldiv()


C Reference function div()

This function of stdlib.h will return the quotient and remainder of the division of numerator by denominator integers n,d.

Usage of div():

div_t div ( int n, int d );

Parameters:

n = numerator

d = denominator

Return value:

More »


Posted in C Reference stdlib.h Functions | Comments Off on C Reference function div()


C Reference function abs()

This function of stdlib will return the absolute value of an integer.

Usage of abs():

int abs ( int x );

Parameters:

An integer x.

Return value:

The absolute value of integer x.

Source code example of abs():

More »


Posted in C Reference stdlib.h Functions | Comments Off on C Reference function abs()


C Reference function floor()

Usage of floor():

double floor(double x);

Parameters:

There is no range limit on the argument.

Return value:

There is no range limit on the return value.

Source code example of floor():

More »


Posted in C Reference math.h Functions | 1 Comment


C Reference function fabs()

Usage of fabs():

double fabs(double x);

Parameters:

There is no range limit on the argument.

Return value:

There is no range limit on the return value.
A negative value becomes positive, positive value is unchanged. The return value is always positive.

Source code example of fabs():

More »


Posted in C Reference math.h Functions | Comments Off on C Reference function fabs()