Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

decimal to hexa 1

Status
Not open for further replies.

homeless

Programmer
Nov 6, 2001
20
CH
i try to convert:
259 to 0x103 or 771 to 0x303

by using the stringstream manipulators

Code:
int n
stringstream ss;
  
ss << hex << n;

cout << ss.str();

what's whrong
 
1. Append semicolon after int n;
2. Initialize n.
3. Append << endl to flush cout.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top