How to convert string to unsigned long number in C

1 Answer

0 votes
#include <stdio.h>
#include <stdlib.h>

int main()
{
    const char *p = "3345322123";

    unsigned long n = strtoul(p, 0, 10);
    
    printf("n = %lu\n", n);
}
 
/*

run:

n = 3345322123

*/

 



answered Jul 20, 2018 by avibootz

Related questions

1 answer 165 views
1 answer 83 views
1 answer 225 views
225 views asked Aug 10, 2019 by avibootz
1 answer 221 views
1 answer 99 views
1 answer 121 views
...