Sets the
basefield
format flag for the
str
stream to
dec
.
When basefield is set to dec , integral numerical values inserted into the stream are expressed in decimal base (i.e., radix 10). For input streams, extracted values are also expected to be expressed in decimal base when this flag is set.
The basefield format flag can take any of the following values (each with its own manipulator):
For standard streams, the basefield flag is set to dec on initialization.
When basefield is set to dec , integral numerical values inserted into the stream are expressed in decimal base (i.e., radix 10). For input streams, extracted values are also expected to be expressed in decimal base when this flag is set.
The basefield format flag can take any of the following values (each with its own manipulator):
| flag value | effect when set |
|---|---|
| dec | read/write integral values using decimal base format. |
| hex | read/write integral values using hexadecimal base format. |
| oct | read/write integral values using octal base format. |
For standard streams, the basefield flag is set to dec on initialization.
本文介绍如何将str流的基数格式标志设置为十进制(dec)。当基数设置为dec时,插入到流中的整数值将以十进制形式表示。对于输入流,预期提取的值也以十进制形式表示。此外,还介绍了基数格式标志可以取的其他值及其效果。
4338

被折叠的 条评论
为什么被折叠?



