Words waiting in input buffer
How do you tell if there is a word waiting in the input buffer? I want the user to be able to enter more than one word, but I want to store them in seperate character arrays. I tried using kbhit(), it hasn't worked. The words keep getting pulled out on following cin calls, instead of inside my looop. I'm using Borland C++ Builder 5, and the cin and cout stream objects. Thanks for any help. Here's the code that I've tried:
void GetCommand( char *s)
{
int i=0;
cout<<s;
cin>>command;
while ( kbhit() )
{
cin>>word[i];
i++;
}
}