text: /* The following code example is taken from the book
   * "The C++ Standard Library - A Tutorial and Reference, 2nd Edition"
   * by Nicolai M. Josuttis, Addison-Wesley, 2012
   *
   * (C) Copyright Nicolai M. Josuttis 2012.
   * Permission to copy, use, modify, sell and distribute this software
   * is granted provided this copyright notice appears in all copies.
   * This software is provided "as is" without express or implied
   * warranty, and with no claim as to its suitability for any purpose.
   */
  #include <iostream>
  #include <fstream>
  #include <string>
  
  int main()
  {
      // write string to a temporarily created file stream (since C++11)
      std::string s("hello");
      std::ofstream("fstream2.tmp") << s << std::endl;
  
      // write C-string to a temporarily created file stream
      // - NOTE: wrote a pointer value before C++11
      std::ofstream("fstream2.tmp", std::ios::app) << "world" << std::endl;
  }
  