adsense


Tuesday, 24 November 2015

C++ LANGUAGE STANDARD ERROR STREAM (CERR)

COMPUTER LANGUAGES HTML,C,C++.JAVA,.NET AND MULTIMEDIA basics and programs click home button



C++ LANGUAGE STANDARD ERROR STREAM (CERR)






The Standard Error Stream (cerr) 


The predefined object cerr is an instance of ostream class. 
The cerr object is said to be attached to the standard error 
device, which is also a display screen but the object cerr 
is un-buffered and each stream insertion to cerr causes its 
output to appear immediately. 

The cerr is also used in conjunction with the stream 
insertion operator as shown in the following example. 

#include <iostream> 
  
using namespace std; 
  
int main( ) 
{ 
   char str[] = "Unable to read...."; 
  
   cerr << "Error message : " << str << endl; 
} 
When the above code is compiled and executed, it produces the following result: 
Error message : Unable to read....


No comments: