嗨,標準命名空間問題
我對編程C++比較新。我知道cout,cin等功能是在標準名稱空間中定義的。但是我們還包含運行該程序的iostream頭文件。
那麼,是不是像
namespace std
{
declaration of cout
declaration of cin
..... some other declarations etc....
}
和內部istream和ostream的... theior實際實現????
或者,它是相反的方向...... ???像....
namespace std
{
complete definition of cout
complete definition of cin
.........
}
和他們的簽名只是放在了iostream文件中像...
iostream file
{
std :: cout
std :: cin
.....
}
請提供您可能認爲會幫助我瞭解任何實例或鏈接更好
它是實現定義的。但類(std :: basic_stream)在名稱空間std內聲明,對象(std :: cin,std :: cout)也是如此。天氣裏有一個定義的頭文件中的類/對象是實現定義的。 – 2010-09-13 14:33:28