c++ problem

Discussion in 'C#' started by creative300, May 23, 2014.

  1. #1
    Hello guys! I have a question for you and I'm sorry if I'm wasting your time.
    I want to know if there is any function that can help you to introduce a value in a certain time.
    For example :
    In the next 3 seconds : cin>>n;
    If you don't introduce a value in 3 seconds the program will go further.
     
    creative300, May 23, 2014 IP
  2. creative300

    creative300 Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #2
    I made this... For those who want to know how :


    Sleep(2000); /* need windows.h */
    if(kbhit()) ....
     
    creative300, May 24, 2014 IP
  3. zinist

    zinist Banned

    Messages:
    91
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    43
    #3
    Using Threading you can achieve this thing with the help of sleep()
    sleep thread for 3000ms i.e 3Sec.
    sleep(3000)
     
    zinist, Jun 26, 2015 IP