May I humbly suggest that you avoid the need to use transcendental functions (log and pow) and those nasty C-style casts by doing this:
void convert_base(int v, int b){
std::stringstream ss;
do { ss << (v % b); } while( v /= b );
std::string s = ss.str();
std::copy( s.rbegin(), s.rend(), ostream_iterator<char>(outputdata) );
outputdata << std::endl;
}
mike_2000_17
Posting Virtuoso
2,139 posts since Jul 2010
Reputation Points: 1,634
Solved Threads: 457