c++的字符串处理问题

来源:百度知道 编辑:UC知道 时间:2024/05/29 21:22:06
#include <iostream.h>
void main()
{
char a;
if(cin.get(a)) cout<<"bbbb";
}

请问cin.get(a)返回的是地址还是字符,还有为什么我输入ctrl+z就不输出bbbb了??

MSDN中是这样写的:
======================================================================
Reads one or more characters from the input stream.
----------------------------------------------------------------------
int_type get();
basic_istream<Elem, Tr>& get(
Elem& _Ch
);
basic_istream<Elem, Tr>& get(
Elem *_Str,
streamsize _Count
);
basic_istream<Elem, Tr>& get(
Elem *_Str,
streamsize _Count,
Elem _Delim
);
basic_istream<Elem, Tr>& get(
basic_streambuf<Elem, Tr>& _Strbuf
);
basic_istream<Elem, Tr>& get(
basic_streambuf<Elem, Tr>& _Strbuf,
Elem _Delim
);
----------------------------------------------------------------------
_Count
The number of characters to read from strbuf.

_Delim
The character that should terminate the read if it is enco