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..
Well i think may be i didn't explained my question clearly
Here it goes again I need a command or function for which user gets only 2 secs to input a value if he doesn't input any thing in that 2 secs the program proceeds.. In actual the problem is when we want an input form user the execution pauses until or unless the user press any thing from keyboard. But what i need is that program only stops for 2 secs if no one inputs any thing than the program move forward.....
Well, you cant use cin or getline or someting, because those commands waits for input.
If you're programming on windows, you can use GetAsyncKeyState(...), wich only checks the state of a certain key and doesnt wait for input. You could place this command in a loop of a wait function (include time.h). For example, if you want to give the user two secconds to quit the program, using escape, you could use this:
Fanx bu this wasn't helpin. i want to make a assignment it goes like
The program should have the functionality to simulate human life e-g a person’s health, emotions, hunger etc should be monitored and incase anything is lower then the required level, the program should alarm and notify about that thing. And also provide a means to fulfill the requirement.
e-g if a person’s hunger is below the least required point, the program will alarm and notify and will also require proteins as an input to recover the hunger meter. The output must be updated constantly and the input can be given any time :S .
I really want to do it ma self. So if i can get the statements codes and their syntaxes that would be really helpful.