[Solved] Function of Base Number 10 to 2,8,16 Ploblem? [closed]


One Problem is, as Tyger mentioned that you didn’t initialize the x, you could get that from a cin like in the menu funciton.
The other problem is that even though you get the string form the functions, you doesn’t write it out. So your main function should look something like this:

int main(){

string out;  // Do you realy need the out string here?
int mod,x;   // or the mod here
int choice;

cout << "Give x: " << endl;
cin >> x;

out = " ";

do{
    menu(choice);
    switch(choice)
    {
        case 1 : cout << base10to2(x) << endl; break;
        case 2 : cout << base10to8(x) << endl; break;
        case 3 : cout << base10to16(x) << endl; break;
    }
}
while(choice != 4);{
cout<<"End Program / Thank You";
}

return 0;

}

1

solved Function of Base Number 10 to 2,8,16 Ploblem? [closed]