Non-decimal radices/Convert: Difference between revisions

added half of c
(added half of c)
Line 155:
===Other libraries or implementation specific extensions===
As of February 2009 no open source libraries to do this task have been located.
 
=={{header|C}}==
<lang c>#include <stdlib.h> // for strtol
 
char *to_base(long num, int base)
{
/* TODO: implement conversion from integer to string of base */
}
 
long from_base(const char *num_str, int base)
{
return strtol(num_str, NULL, base);
}</lang>
 
=={{header|C++}}==
Anonymous user