标签:对象 text ace std ext mes int ret pac
void clear() noexcept;
功能:把string对象置为空
#include <iostream>
#include <string>
using namespace std;
int main()
{
char c;
string str;
cout << "please enter text\n";
do{
c = cin.get();
str += c;
if(c == ‘\n‘)
{
cout << str;
str.clear();
}
}while(c != ‘.‘);
return 0;
}
标签:对象 text ace std ext mes int ret pac
原文地址:https://www.cnblogs.com/xpylovely/p/12085044.html