Use strtoull to convert string to unsigned long long int

Syntax

C strtoull function has the following format.

unsigned long long int strtoull(const char *restrict start, char **restrict end, int radix);

C strtoull function is from header file stdlib.h.

Description

C strtoull function is similar to strtoul() except that it returns an unsigned long long int.

If the result cannot be represented as an unsigned long integer, ULLONG_MAX is returned. If *start is a number, no conversion takes place and zero is returned.

Example

Convert string to unsigned long long int by using C strtoull function.


#include <stdlib.h>
/*w w w. j  a  va 2  s.c om*/
int main(void){

    char *start, *end;
    char a[100];

    end = a;
    *start= "12341234";
    printf("%d", strtoull(start, &end, 8));

}




















Home »
  C Language »
    Function Reference »




assert.h
ctype.h
math.h
setjmp.h
signal.h
stdio.h
stdlib.h
string.h
time.h
wctype.h