Can anyone show or explain how to do a base conversions ? I'm new so this concept is confusing
so far i got to
but I have no clue to get answer from base 10 to any base 2 to base 16
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
int main(int argc, char *argv[])
{
if(argc=3)
{ int num1 = atoi(argv[1])
char* bVar = argv[2];
int bVal;
if (bVar[0] == 'b')
{
bVal = atoi(bVar + 1);
}
if( bVal < 2 || bVal > 16 )
{cout << "X" << endl; }