You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
436 B
C++
15 lines
436 B
C++
#ifndef _BASE_HELP
|
|
#define _BASE_HELP
|
|
#include <string>
|
|
|
|
/* Convert the given value from the given base, to base 10 */
|
|
unsigned int to_decimal(std::string num, int from_base);
|
|
|
|
/* Convert the given value from base 10 to the given base */
|
|
std::string from_decimal(unsigned int num, int to_base);
|
|
|
|
/* Convert the given value from 'from_base', to 'to_base' */
|
|
std::string base_convert(std::string num, int from_base, int to_base);
|
|
|
|
#endif
|