السلام عليكم
أرجو منكم مساعدتي في هذا الكود :
#include<iostream>
#include<string>
using namespace std ;
int main()
{
string word ="";
char x ;
cout<<"enter your words :";
while (cin.get(x))
{
if (x=='\n')
{
break ;
}
word += x ;
cout<<word<<endl;
}
cout<<"Out of While : "<<word<<endl;
system("pause");
}و بالتحديد هذا السطر :
while (cin.get(x))
هذه صورة لمخرجات البرنامج :

تحياتي.
