Quick, Simple, Question

Well, after everything my brother has taught me, and after reading numerous online tutorials... one question I've had from the start was never answered.

Maybe I missed it, or it simply doesn't exist.

My question is: Are there "Wait" commands in C++?

Example: With DarkBASIC, there are two wait commands. "Sleep" and "Wait".

[code]
Print "Hello, welcome to DarkBASIC."
Wait 5000
Print "You just witnessed a wait command."
[/code]

...now that everyone knows what language I learned first :P.

Anyways, so are there any commands like this? I know there's the "system("PAUSE")" command, but I'd like to be able to have areas of my programs "wait" automatically instead of needing some sort of input from a human....

All or any info. is appreciated.
[hr]
[blue](=@'')=@ [red]PoW[/red] @=(''@=)[/blue]
[blue]-LostLilBro[/blue]

Comments

  • : Well, after everything my brother has taught me, and after reading numerous online tutorials... one question I've had from the start was never answered.
    :
    : Maybe I missed it, or it simply doesn't exist.
    :
    : My question is: Are there "Wait" commands in C++?
    :
    : Example: With DarkBASIC, there are two wait commands. "Sleep" and "Wait".
    :
    : [code]
    : Print "Hello, welcome to DarkBASIC."
    : Wait 5000
    : Print "You just witnessed a wait command."
    : [/code]
    :
    : ...now that everyone knows what language I learned first :P.
    :
    : Anyways, so are there any commands like this? I know there's the "system("PAUSE")" command, but I'd like to be able to have areas of my programs "wait" automatically instead of needing some sort of input from a human....
    :
    : All or any info. is appreciated.
    : [hr]
    : [blue](=@'')=@ [red]PoW[/red] @=(''@=)[/blue]
    : [blue]-LostLilBro[/blue]
    :


    Sleep(n);
    where n is in mseconds.
    don't forget to include

    ak

  • Standard C and C++ libraries do not support operating system dependent functions. For that you have to use libraries that were developed by the compiler manufacturers or operating system API function. Microsoft Windows API Sleep() (capital 'S'), Unix/Linux sleep() (lower-case 's'), and Turbo-C for MS-DOS delay() all do what you want. Read your compiler's documentation to find out which one of these to use and appropriate parameters.
  • Okay, thanks both of you. That's what I was looking for.

    [hr]
    [blue](=[red]@[/red]'')[red]@[/red] [red]PoW[/red] [red]@[/red](''[red]@[/red]=)[/blue]
    [blue]~LostLilBro~[/blue]

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories