Help with getch();
Why does getch(); have to get the character before it will output the cout<< before it???
void displayalbum(NODE* &head,apstring &album)
cout<<" "<<node->album<<endl<<" Loaned : "<<node->loaned<<endl;
cout<<" To : "<<node->towho<<endl;
cout<<"* CD NOT FOUND *\n\n";
cout<<"Press any key to continue.";
I tried using _getch(); but it gave me the same problem... any more suggestions???
The problem you are having is because cout is buffered....
cout<<'\n'; // this does not flush the buffer.
cout<<endl; // this on the other hand will.
to flush specifically without using a newline ....
cout<<"Are you starting to get it??"<<flush;
cout will also be flushed on any call to cin (providing you have not untied the streams).
cout<<"Press any key to continue.Test" << endl << flush ;
I think you just need to force (flush) the output.
Thanks, that fixed the problem...