Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

c long to string

const int n = snprintf(NULL, 0, "%lu", ulong_value);
assert(n > 0);
char buf[n+1];
int c = snprintf(buf, n+1, "%lu", ulong_value);
assert(buf[n] == '');
assert(c == n);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #long #string
ADD COMMENT
Topic
Name
7+4 =