ends (Standard C++ Library)

Terminates a string.

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

Parameters

  • _Elem
    The element type.

  • _Ostr
    An object of type basic_ostream.

  • _Tr
    Character traits.

Return Value

An object of type basic_ostream.

Remarks

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

See Also

Reference

iostream Programming

iostreams Conventions

Other Resources

<ostream> Members