为了账号安全,请及时绑定邮箱和手机立即绑定

cin.get(next);什么意思?

cin.get(next);什么意思?

C C++
xungeer29 2017-10-27 21:40:28
// static.cpp -- using a static local variable #include <iostream> // constants const int ArSize = 10; // function prototype void strcount(const char * str); int main() { using namespace std; char input[ArSize]; char next; cout << "Enter a line:\n"; cin.get(input, ArSize); while (cin) { cin.get(next);                    //这一句什么意思?next=input? while (next != '\n') // string didn't fit! cin.get(next); // dispose of remainder strcount(input); cout << "Enter next line (empty line to quit):\n"; cin.get(input, ArSize); } cout << "Bye\n"; return 0; } void strcount(const char * str) { using namespace std; static int total = 0; // static local variable int count = 0; // automatic local variable cout << "\"" << str <<"\" contains "; while (*str++) // go to end of string count++; total += count; cout << count << " characters\n"; cout << total << " characters total\n"; }cin.get(next); 是什么意思?
查看完整描述

目前暂无任何回答

  • 0 回答
  • 0 关注
  • 1840 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信