8.3-3

int main()
{
  cin.tie(&cout);//tie函數可用istream或ostream對象調用


  ostream *old_tie=cin.tie();//使用一個指向ostream對象的指針形參


  //cin.tie()返回當前所綁定的對象
  *cin.tie()<<"hello world"<<endl;//輸出hello world


  cin.tie(0);//打破該流上已存在的對象

  //*cin.tie()<<"hello world"<<endl; error
 

 


  system("pause");

}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章