1)将输入当做文本进行处理,并用成员函数get来读取输入时,就使用成员函数eof。
2)处理数值数据时,使用>>操作符,例:
while(in_stream>>next)
{
sum=sum+next;
count++;
}