Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      Standard library header <iostream>

      From cppreference.com
      <cpp‎ |header
       
       
      Standard library headers
       

      This header is part of theInput/output library.

      Including<iostream> behaves as if it defines a static storage duration object of typestd::ios_base::Init, whose constructor initializes the standard stream objects if it is the firststd::ios_base::Init object to be constructed, and whose destructor flushes those objects (except forcin andwcin) if it is the laststd::ios_base::Init object to be destroyed.

      Contents

      Includes

      (C++11)
      std::ios_base class,std::basic_ios class template and typedefs[edit]
      std::basic_streambuf class template[edit]
      (C++11)
      std::basic_istream class template and typedefs[edit]
      (C++11)
      std::basic_ostream,std::basic_iostream class templates and typedefs[edit]

      Objects

      reads from the standard C input streamstdin
      (global object)[edit]
      writes to the standard C output streamstdout
      (global object)[edit]
      writes to the standard C error streamstderr, unbuffered
      (global object)[edit]
      writes to the standard C error streamstderr
      (global object)[edit]

      [edit]Synopsis

      #include <ios>#include <streambuf>#include <istream>#include <ostream> namespace std{extern istream cin;extern ostream cout;extern ostream cerr;extern ostream clog; extern wistream wcin;extern wostream wcout;extern wostream wcerr;extern wostream wclog;}

      [edit]Defect reports

      The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

      DRApplied toBehavior as publishedCorrect behavior
      LWG 155C++98the type of the static object wasstd::basic_ios::Init
      (not strictly wrong, but the wording was misleading)
      corrected tostd::ios_base::Init
      LWG 1123C++98including<iostream> did not guarantee the
      construction ofstd::ios_base::Init objects
      guarantees
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/header/iostream&oldid=164046"

      [8]ページ先頭

      ©2009-2025 Movatter.jp