istream::operator >>
istream& operator >>( char* psz );
istream& operator >>( unsigned char* pusz );
istream& operator >>( signed char* pssz );
istream& operator >>( char& rch );
istream& operator >>( unsigned char& ruch );
istream& operator >>( signed char& rsch );
istream& operator >>( short& s );
istream& operator >>( unsigned short& us );
istream& operator >>( int& n );
istream& operator >>( unsigned int& un );
istream& operator >>( long& l );
istream& operator >>( unsigned long& ul );
istream& operator >>( float& f );
istream& operator >>( double& d );
istream& operator >>( long double& ld ); (16-bit only)
istream& operator >>( streambuf* psb );
istream& operator >>( istream& (*fcn)(istream&) );
istream& operator >>( ios& (*fcn)(ios&) );
这些是本来>>支持的类型。
对于cin来说,如cin>>(int)a,而输入一字符串,则会使cin陷入错误状态,故在输入之前应该先检查if(isdigit(a))。
posted on 2006-06-27 21:34
栗子 阅读(472)
评论(1) 编辑 收藏 引用 所属分类:
学习有感