473,406 Members | 2,745 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,406 software developers and data experts.

[C++] Timer WHILE waiting for input

Lets say we're doing a maths quiz program, and each question will be skipped
if the timer expires without any input.

Surfing through the net I see a way to do it with kbhit(), but it limits the
input to just one character, is there anyway to do more complex inputs?
Jul 19 '05 #1
1 5188

Poof <se******@hotmail.com> wrote in message news:3f27ca88@shknews01...
Lets say we're doing a maths quiz program, and each question will be skipped if the timer expires without any input.
ISO standard C++ (the topic here) does not support
nonblocking input. You'll need a platform-specific
solution.

Surfing through the net I see a way to do it with kbhit(),
This shows why it's not a good idea to depend upon "C++
information" you might find on the web. The large majority
of it is simply wrong. There is no such function 'kbhit()'
in standard C++. Some PC-based compilers do provide such
a function, but each implementation will work in its own
way, and in a platform-specific manner.
but it limits the
input to just one character, is there anyway to do more complex inputs?


There is no way to do nonblocking input in standard C++.

Try a newsgroup about your platform and/or implementation.

-Mike

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: DaveF | last post by:
I am trying to write a service to fire an ftp object off. I want to wait 2 minutes and then download the files. Then repeat every 2 minutes. The files just seem to stop downloading. Does that timer...
7
by: Lamis | last post by:
HI, I need to have a blinking battery in my application. I thought timer is the best way to make that... My problem is that my timer is disabled when my application starts and when...
4
by: Liverpool fan | last post by:
I have a windows application written using VB .NET that encompasses a countdown timer modal dialog. The timer is a System.Timers.Timer with an interval of 1 second. AutoReset is not set so accepts...
19
by: adi | last post by:
Hi I need the following: at particular times of day, I want to make some processing. System.Windoes.Timer doesn't help much, because it exposes the Interval property. Instead, I need to tell...
4
by: grayaii | last post by:
Hi, I have a simple form that handles all its paint functionality like so: this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque, true); And the entry point to this...
19
by: UG | last post by:
I just wanted to know whether any timer facility exists in C, as it is not mentioned in K&R 2, or in the ISO Draft. By timer function i mean that when we use standard input function like scanf() or...
11
by: =?Utf-8?B?RXJpYw==?= | last post by:
I'm coming from Win32 world. Now, I'm porting the existing code to C#. I cannot find the equivalent Win32 Waitable Timer in C#. I have a thread to perform some task periodically like following: ...
2
by: Amit Dedhia | last post by:
Hi I am developing a scientific application which has moderate level image processing involved. In my application, there is a main application form which invokes another form. When this form...
1
by: Gabriel Genellina | last post by:
En Fri, 30 May 2008 22:50:13 -0300, Robert Dailey <rcdailey@gmail.com> escribió: Use an Event object; its wait() will provide the sleep time, and when it is set() the thread knows it has to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...

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.