#include "iostream"
using namespace std;
int main(void)
{
char buff='\0';
string str1;
for(;buff!='@';)
{
str1+=buff;
cin.get(buff);
}
cout<<"you input is: \n"<<str1;
}
for_cin会把输入存在缓冲区。
#include "iostream"
using namespace std;
int main(void)
{
char buff='\0';
string str1;
for(;buff!='@';)
{
str1+=buff;
cin.get(buff);
}
cout<<"you input is: \n"<<str1;
}
for_cin会把输入存在缓冲区。