I wrote the code below which inputs a number in hex format and outputs it in decimal form:-
#include<iostream>
#include<iomanip>
#include<stdint.h>
using namespace std;
int main()
{
uint8_t c;
cin>>hex>>c;
cout<<dec<<c;
//cout<<sizeof(c);
return 0;
}
But when I input c(hex for 12), the output was again c(and not 12). Can somebody explain?