Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
We recommend using Visual Studio 2017

left

 

Causes text that is not as wide as the output width to appear in the stream flush with the left margin.


      ios
      _
      base& left(
   ios_base& _Str
);

_Str

A reference to an object of type ios_base, or to a type that inherits from ios_base.

A reference to the object from which _Str is derived.

The manipulator effectively calls _Str.setf(ios_base::left, ios_base::adjustfield), and then returns _Str.

Example

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

int main( ) 
{
   using namespace std;
   double f1= 5.00;
   cout.width( 20 ); 
   cout << f1 << endl;
   cout << left << f1 << endl;
}
                   5
5

Requirements

Header: <ios>

Namespace: std

Show: