Thread: help a newb...

  1. #1
    Registered User
    Join Date
    Dec 2002
    Posts
    2

    help a newb...

    Plz someone who knows answer these...

    1) how can i do that some functions in C++ will work by the time that working the function getch(); and i am not pressing on a key?
    2)how can i do a function like
    getch(); limited in time. i mean that it will cotinue the programm without the function getch(); if there was not pressed a button in 3 seconds
    3) in a dos version of C++ there is a "delay" function. is there one like it in windows? (yes/no) if yes, what is the name of this function and what is the include of it?

    oh and sorry for my bad english, i only started studying it a short time ago.

  2. #2
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    1) sorry i speak english.
    2) You can use functions in <ctime> to help you here.
    3) Sleep(DWORD milliseconds) in <windows.h>
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  3. #3
    Neoseeker's master master2000's Avatar
    Join Date
    Dec 2002
    Posts
    101

    Post learn this first.

    listen i may help you if you rephase it

    if you are unclear on english learn that first then use proper gramer then people will help you.
    if you cant type or were in a hurry slow down.

  4. #4
    Registered User datainjector's Avatar
    Join Date
    Mar 2002
    Posts
    356

    Re: learn this first.

    Originally posted by master2000
    listen i may help you if you rephase it

    if you are unclear on english learn that first then use proper gramer then people will help you.
    if you cant type or were in a hurry slow down.
    ShutUp numscore He stated that he just started learning english.
    "I wish i could wish my wishs away"

    "By indirections find directions out" -- William Shakespears

    "Do what thou wilt shall be the whole of the law" -- Crowley "THE BEAST 666"

    Mizra -> love = Death...
    RDB(Rocks yooo)..

    http://www.cbeginnersunited.com

    Are you ready for the Trix ???

  5. #5
    Neoseeker's master master2000's Avatar
    Join Date
    Dec 2002
    Posts
    101
    Originally posted by Stoned_Coder
    1) sorry i speak english.
    Ok , that was harsh. you should say some thing like " 1) you sould improve your gramer"
    then that is enlish he just needs to improve on it.

  6. #6
    Neoseeker's master master2000's Avatar
    Join Date
    Dec 2002
    Posts
    101

    Re: Re: learn this first.

    Originally posted by datainjector
    ShutUp numscore He stated that he just started learning english.
    seems like you did too, what kind of insult is numscore.

  7. #7
    Registered User
    Join Date
    Dec 2002
    Posts
    2
    Right, i got someone to rephrase it for me...

    got the 2nd and 3rd answers from Stoned_Coder, thx

    Now the 1st...

    1) How can I make a certain function work (for example, making something move, etc.) at the same time that the getch(); function is requesting me to press something ?

    thx guys, I appreciate it

  8. #8
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    look up nonstandard function kbhit() which on some compilers resides in <conio.h> this is a non standard header and function but most compilers offer it. itt may be known as _kbhit(). This will allow you to check for a keypress before calling getch therefore when no key pressed you can do something else. Failing that there is always threads!
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Newb Question Character Counting
    By Wilder in forum C Programming
    Replies: 13
    Last Post: 06-22-2008, 11:37 PM
  2. Dogpile the newb!
    By lindy in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 05-23-2008, 08:17 AM
  3. Total newb directx invisable geometry question
    By -pete- in forum Game Programming
    Replies: 5
    Last Post: 08-13-2006, 01:45 PM
  4. Newb C++ Programmer
    By Philandrew in forum C++ Programming
    Replies: 8
    Last Post: 10-19-2004, 08:44 PM
  5. if your not newb you can help me
    By Klinerr1 in forum C++ Programming
    Replies: 6
    Last Post: 05-05-2002, 12:09 AM