C
Christian Johannes Charbula
hi,
does anybody know how i can get the information what width for a
ostream is actually set?
i want to do somthing like the following, and need a way to do something
like stream.getw().
inline std:
stream& operator << (std:
stream &stream, const FixPoint
&fixPoint)
{
return
stream
// << std::setw (stream.getw()-fixPoint.m_fractionDigits-1)
<< std::setfill('0')
<< fixPoint.m_value / fixPoint.m_multiplicator << "."
<< std::setw (fixPoint.m_fractionDigits) << std::setfill('0')
<< fixPoint.m_value % fixPoint.m_multiplicator;
}
FixPoint test (42.30);
cout << setw (10) << test;
thanks,
chrisitian
does anybody know how i can get the information what width for a
ostream is actually set?
i want to do somthing like the following, and need a way to do something
like stream.getw().
inline std:
&fixPoint)
{
return
stream
// << std::setw (stream.getw()-fixPoint.m_fractionDigits-1)
<< std::setfill('0')
<< fixPoint.m_value / fixPoint.m_multiplicator << "."
<< std::setw (fixPoint.m_fractionDigits) << std::setfill('0')
<< fixPoint.m_value % fixPoint.m_multiplicator;
}
FixPoint test (42.30);
cout << setw (10) << test;
thanks,
chrisitian