LinuxQuestions.org
Help answer threads with 0 replies.
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-27-2010 at 12:45 AM by MWH
Updated 01-27-2010 at 12:59 AM 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 2098 Comments 0 MWH is offline

  



All times are GMT -5. The time now is 03:58 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration