[QUOTE]cerr
Specifies the cerr global stream.
extern ostream cerr;
Return Value
An ostream object.
Remarks
The object controls unbuffered insertions to the standard error output as a byte stream. Once the object is constructed, the expression cerr.flags & unitbuf is nonzero.
Example:
// iostream_cerr.cpp
// compile with: /EHsc
// By default, cerr and clog are the same as cout
#include <iostream>
#include <fstream>
using namespace std;
void TestWide( )
{
int i = 0;
wcout << L"Enter a number: ";
wcin >> i;
wcerr << L"test for wcerr" << endl;
wclog << L"test for wclog" << endl;
}
int main( )
{
int i = 0;
cout << "Enter a number: ";
cin >> i;
cerr << "test for cerr" << endl;
clog << "test for clog" << endl;
TestWide( );
}
Input
3
1
Sample Output
Copy Code
Enter a number: 3
test for cerr
test for clog
Enter a number: 1
test for wcerr
test for wclog
[/QUOTE]
clog:
extern ostream clog;
The object controls buffered insertions to the standard error output as a byte stream.
cout:The object controls insertions to the standard output as a byte stream.
呵呵,不用翻译了吧,很易懂的。平时多查查MSDN,很有帮助的,对英语也是一种提高哦
[此贴子已经被作者于2007-5-3 20:35:09编辑过]