Thank you but we cannot because in Hexadecimal we have for example 3C1 and we should convert C to 12
My suggested change will do that. In fact, the only difference between your Convert() and mine is that I used some character constants instead of magic numbers.
So we should get Hexa in a string variable.
I understand that. Your program has: string num;
and I am suggesting that you read it with: cin >> num;