Answers for "long to str in c"

C
0

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);
Posted by: Guest on August-21-2021

Code answers related to "C"

Browse Popular Code Answers by Language