Unknown error

I am getting this error that I have never seen before. It seems to be related to
setiosflags( ios::fixed || ios::showpoint ).

Error is ||=== Build: Debug in Learning (compiler: GNU GCC Compiler) ===|
C:\Users\Fam Bam\Documents\C++ Files\Practice\Learning\main.cpp||In function 'int main()':|
C:\Users\Fam Bam\Documents\C++ Files\Practice\Learning\main.cpp|15|error: cannot convert 'bool' to 'std::ios_base::fmtflags {aka std::_Ios_Fmtflags}' for argument '1' to 'std::_Setiosflags std::setiosflags(std::ios_base::fmtflags)'|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|




1
2
3
4
5
6
// the
setiosflags( ios::fixed || ios::showpoint );

// is like
const bool flags = ios::fixed || ios::showpoint;
setiosflags( flags );

However, bool is not same as ios_base::fmtflags and that is what the setiosflags wants.

Consider the difference of logical OR (||) that returns a bool
and bitwise OR (|) that returns something
Topic archived. No new replies allowed.