[C++Primer]第1章開始

693 ワード

きほんにゅうしゅつりょく
iostreamライブラリ
2つのベース・タイプ
  • istream
  • ostream

  • 標準入出力オブジェクト
  • cin
  • cout
  • cerrは、警告およびエラーメッセージ
  • を出力するために使用される.
  • clogは、記録情報
  • を出力するために用いる.
    ストリームへのデータの書き込み/出力
  • 出力演算子<<
  • std::cout << "Print message" << std::endl;
    
  • 入力演算子>>左側のオブジェクト(cin)を計算結果として返す
  • char *str;
    std::cin >> str;
    

    C++のコメント
  • 単一行注釈
  • // std::cout << "Print message" << std::endl;
    
  • 定義子注釈に対して
  • をネストすることはできない.
    /*
    std::cout << "Print message" << std::endl;
    */