Hi i am bilal n i am new here
i need to make a program on Human simulation.......
Well what i need is a code. when i am executing a program like am printing 'x' for infinite many times during execution when the console is printing x infinitely what can i do to stop that and 1 more
i also need a statement that take input from user bu without waiting for user to input or if the user inputs nuffin in 2 secs the program shall proceed ahead .....................
PLZ PLZ PLZ PLZ PLZ PLZ help me i really need buth of those or atleast the latter one.
Chaudharybilal
0
Newbie Poster
Recommended Answers
Jump to PostScan for input, and
break;
when you get some.In the loop checking for input, set up a counter with clock() and check if it's been two or so seconds, in the loops condition.
Jump to PostSpawn a thread to count two seconds, after that make your tread force '\n' into the keyboard buffer and there you go
Chris
All 6 Replies
MosaicFuneral
812
Nearly a Posting Virtuoso
Chaudharybilal
0
Newbie Poster
Chaudharybilal
0
Newbie Poster
Freaky_Chris
299
Master Poster
WaltP
2,905
Posting Sage w/ dash of thyme
Team Colleague
Chaudharybilal
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.