Interpréter une chaîne de caractères comme une valeur numérique de type int et retourner un ‘unsigned long’

Author:


{filelink=13223}

/*
#include 
unsigned long strtoul ( const char * restrict s , char ** restrict endptr ,
                       int base  );
unsigned long long strtoull (  const char  *  restrict s , char ** restrict endptr ,
                             int base  );         (C99)
*/

#include 
#include 

int main(void){

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

    end = a;
    start= "44.16.21.10";
    printf("%d", strtoul(start, &end, 8));
return 0;
}

Leave a Reply

Your email address will not be published. Required fields are marked *