C++ CIN stream
Hi
Is there any way I can use the iostream so characters can be outputted to the screen while it is waiting for input? IN others words can I cout while im cin ''ing
The reason I want this is because I have a coded a simple network chat program that is console based.
Cheers
use somethign like:
put that in a thread using CreateThread or something then just put a while(cin >> data) loop in your main()
hope that helps
Edited by - barazor on November 18, 2001 2:31:24 PM
void* OutputThread(){ while(1) // loop forever { cout << something; // data goes here }}
put that in a thread using CreateThread or something then just put a while(cin >> data) loop in your main()
hope that helps
Edited by - barazor on November 18, 2001 2:31:24 PM
However, you also want to be able to erase what you''ve typed (using the backspace key, right?)
cin and cout are not to be thought of as functions; they''re objects, which means they have methods (very useful methods) that can provide more refined behavior. Look into basic_istream::get(), basic_istream::putback() and basic_istream::read().
cin and cout are not to be thought of as functions; they''re objects, which means they have methods (very useful methods) that can provide more refined behavior. Look into basic_istream::get(), basic_istream::putback() and basic_istream::read().
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement