📄 get.cpp
字号:
#include <iostream>
#include <string>
using namespace std;
string readName(istream& inStream);
int main()
{
cout << "Reading a name from cin. You can usually close cin with Control-D (Control-Z in Windows): ";
string theName = readName(cin);
cout << "The name is " << theName << endl;
}
string readName(istream& inStream)
{
string name;
char next;
while (inStream.get(next)) {
name += next;
}
return name;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -