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.
netpong/includes/numeric_base.hpp

15 lines
418 B
C++

#ifndef _BASE_HELP
#define _BASE_HELP
#include <string>
/* Convert the given value from the given base, to base 10 */
int to_decimal(std::string num, int from_base);
/* Convert the given value from base 10 to the given base */
std::string from_decimal(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