I'm reading Larry Ullman's C++ Programming:Visual Quickstart Guide. He says to use the command std::cout.setf(std::ios::fixed)) (with others) to set the number of digits after a decimal. But all of his code uses std::cout::setf(std::ios_base::fixed). What is the difference?
raptoro104
0
Newbie Poster
Recommended Answers
Jump to Post
std::ios
is outdated:The C++ Standard has replaced
ios::fixed
withios_base::fixed
andios::floatfield
withios_base::floatfield
. If your compiler does not accept theios_base
forms, try usingios
instead; that is, substituteios::fixed
forios_base::fixed
, etc.Hope this helps
All 3 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.