zoukankan      html  css  js  c++  java
  • setf

    ios_base::fmtflags:  使用setf函数设置 
    independent flags boolalpha read/write bool elements as alphabetic strings (true and false).
    showbase write integral values preceded by their corresponding numeric base prefix.
    showpoint write floating-point values including always the decimal point.
    showpos write non-negative numerical values preceded by a plus sign (+).
    skipws skip leading whitespaces on certain input operations.
    unitbuf flush output after each inserting operation.
    uppercase write uppercase letters replacing lowercase letters in certain insertion operations.
    numerical base
    (basefield)
    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.
    float format
    (floatfield)
    fixed write floating point values in fixed-point notation.   ---------usually used  将浮点数用定点数表示
    scientific write floating-point values in scientific notation.                                       科学计数法
    adjustment
    (adjustfield)
    internal the output is padded to the field width by inserting fill characters at a specified internal point. 特定处补零
    left the output is padded to the field width appending fill characters at the end.            结束补零
    right the output is padded to the field width by inserting fill characters at the beginning. 开头补零

      std::cout.setf ( std::ios::showbase );  带0x 等前缀。

     

  • 相关阅读:
    python os.stat() 和 stat模块详解
    Python中datetime库的用法
    js中Array的map()函数,其中的回调函数还能这么用
    通常用于返回值的三目运算符
    浏览器渲染页面的时候,不同的script块之间的关系
    模板字面量
    let和const
    js 数组 map方法
    一些常用的js循环,如for
    session
  • 原文地址:https://www.cnblogs.com/gaoxianzhi/p/3222713.html
Copyright © 2011-2022 走看看