internal (标准 C++ 库)

生成一个数字符号左侧对齐和该数字与右侧对齐。

ios_base& internal(
   ios_base& _Str
);

参数

  • _Str
    对类型 ios_base对象,或者从 ios_base继承的类型。

返回值

为 _Str 派生的对象的引用。

备注

showpos 导致该符号为正数显示。

操作者有效调用 _Str。setf(ios_base::internalios_base::adjustfield),然后返回 _Str。

示例

// ios_internal.cpp
// compile with: /EHsc
#include <iostream>
#include <iomanip>

int main( void ) 
{
   using namespace std;
   float i = -123.456F;
   cout.fill( '.' );
   cout << setw( 10 ) << i << endl;
   cout << setw( 10 ) << internal << i << endl;
}
  

要求

标头: <ios>

命名空间: std

请参见

参考

iostream编程

(mfc)约定