basic_ostream::put

Places a single character in the output stream.

  basic_ostream<charT, traits>& put(char_type c);
  
Remarks

The unformatted function put() inserts one character in the output stream. If the operation fails, it calls setstate(badbit).

The this pointer is returned.

Listing: Example of basic_ostream::put() usage:
#include <iostream>
int main()

{

using namespace std;

   char *str = "CodeWarrior \"Software at Work\"";

   while(*str) 

   { 

      cout.put(*str++);

   }

   return 0;

}

Result:

  CodeWarrior "Software at Work"