LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Blogs > MWH
User Name
Password

Notices


Programming on Linux This is about programing techniques of programming languages on Linux distros. For now it's about C++ but in future new languages will be added too.
Old

Why ios::hex and ios::oct Does not Work in C++

Posted 01-26-2010 at 11:45 PM by MWH
Updated 01-26-2010 at 11:59 PM by MWH

Someone might think ios:ct and ios::hex doesn't work in Linux for some unknown reason. The thing is that I have got to know why it's happening. Actually there is no problem, the thing is by default ios::dec turned on in C++. So we have to turn it off by typing cout.unsetf(ios::dec); before our cout statement or cout<<hex<<21323<<endl;.


Eg:-1.


#include<iostream>

#include<iomanip>

using namespace...
MWH
LQ Newbie
Views 2196 Comments 0 MWH is offline

  



All times are GMT -5. The time now is 08:40 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration