I wrote a simple program to take input till the char array is filled up. But i seem to be getting a problem during runtime that the program takes input continuously and never stops.
Pls help in identifying the problem.(there were no errors during compiling)
#include<iostream>
#include<string>
using namespace std;
int main(){
char a[10];
int n=0;
while(cin>>a[n]) {n++;}
cout<<a;
return 0;
}