c ++ base for the conversion of some of the simple tips (continually updated)

Base conversion is always time to time to harass you and let you keep track of, it was decided to summarize some of the convenient ways:

Direct output:

int Test; 
COUT << " the Input Test Data: " << endl; 
CIN >> Test; 
COUT << " Binary: " << the bitset < 10 > (Test) << endl; // Decimal Binary turn cout << " octal: "the OCT << << << endl the Test; // decimal turn octal 
cout << " decimal: " << endl << dec << the Test; // decimal decimal turn 
cout << " hex: " << hex << test << endl;// decimal convert hexadecimal

... may still be some. . . (Fog)

Guess you like

Origin www.cnblogs.com/ever17/p/10963236.html