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.

ends (Standard C++ Library)

 

Terminates a string.


      template class<
      _Elem
      , 
      _Tr>
   basic_ostream<_Elem, _Tr>& ends(
      basic_ostream<_Elem, _Tr>& _Ostr
);

_Elem

The element type.

_Ostr

An object of type basic_ostream.

_Tr

Character traits.

An object of type basic_ostream.

The manipulator calls _Ostr.put(_Elem('\0')). It returns _Ostr.

Example

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

int main( ) 
{
   using namespace std;
   cout << "a";
   cout << "b" << ends;
   cout << "c" << endl;
}
ab c

Requirements

Header: <ostream>

Namespace: std

Show: