473,411 Members | 2,285 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

How to delay to get a character

for my gaming technique... .i need one information

whts that is i want to get one character using getch(). but my problem is i want to get that character at an certain amount of time..... if it exeeds and the user doesnt press any key means.... it wil go to some other action. like tak it this an example...
int/char c;

c=getch(); this statement executed with in a period of some time...
if the user press any key meas then assign the value for c=10.
At that particular tim of period of tim if the user does not press any key means assign c=0;

Any one clarify my doubt plz.......
Sep 12 '07 #1
2 1435
kreagan
153 100+
for my gaming technique... .i need one information

whts that is i want to get one character using getch(). but my problem is i want to get that character at an certain amount of time..... if it exeeds and the user doesnt press any key means.... it wil go to some other action. like tak it this an example...
int/char c;

c=getch(); this statement executed with in a period of some time...
if the user press any key meas then assign the value for c=10.
At that particular tim of period of tim if the user does not press any key means assign c=0;

Any one clarify my doubt plz.......
Try using an interrupt which brings you to the other action.
Sep 12 '07 #2
weaknessforcats
9,208 Expert Mod 8TB
getch() will not be called until the user presses the enter key. If the user never presses enter, your program will wait forever.
Sep 12 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Salty Dog | last post by:
Code: <%Response.Buffer = False%> <HTML> <HEAD> <title>Printing</title> </HEAD> <BODY> <center> <% FilePath = "c:\WUTemp\441817810_receiver.txt"
3
by: richard | last post by:
I am trying to do non-delay mode read from cin, i.e. char ch; ... while( cin.getch(ch) ) { ... } I want getch to return whenever there is a char typed (not wait till a newline is seen).
2
by: ShawnD | last post by:
I'm having some issues when trying to read input off of a pipe using a python script. I'm trying to process packet data from tcpdump in real-time, so it's a filter that needs to read data while the...
5
by: IgorZ | last post by:
Hello i made a program based on the tutorial on youtube. It's suppose to calculate the average between 3 numbers so i got some questions about that. 1. How to detect when a person enters a number...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.