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

how to quit

Hi,
Thanks to those who replied to my question.
Well the actual thing is when i make a program in C,user can only exit
from it when that particular code lie is executed.
In that line i use any suitable input function then i compare it using
if function. there if condition is true, it exits otherwise not.
Now i want this capability that user doesn't have to wait for that
particular line to be executed.
Whenever he presses a particular key, lets say Q, my program picks it,
compares and exit.
I mean that such function would be running in the background
simultaneously with other functions or lines of my program.
Is it possible and how?

Mar 29 '07 #1
1 1406
On 29 Mar, 04:56, "Thomas" <mynameisthomasander...@gmail.comwrote:
Well the actual thing is when i make a program in C,user can only exit
from it when that particular code lie is executed.
In that line i use any suitable input function then i compare it using
if function. there if condition is true, it exits otherwise not.
Now i want this capability that user doesn't have to wait for that
particular line to be executed.
Whenever he presses a particular key, lets say Q, my program picks it,
compares and exit.
I mean that such function would be running in the background
simultaneously with other functions or lines of my program.
Is it possible and how?
It is possible, but the mechanism to accomplish it will
depend on the system you are using and it cannot be
done portably. You must use things that are outside of
the C language itself. (eg [n]curses and/or threads.)
You will get better responses if you post your question
to a group dedicated to the system on which you are
trying to accomplish this task. Although, as has
been mentioned, you might find it easier to use the
mechanism provided by your system for terminating
you process. For example, on most (probably all)
unix-like systems, ctrl-C (or some other keystroke)
will send a signal to the foreground process (your
program). By default, your program will terminate
when it receives that signal, but you can catch
the signal and take other actions if you wish. However,
that is outside the scope of the language itself, and
you should really take the question to a system specific
news group.

--
Bill Pursell

Mar 29 '07 #2

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

Similar topics

1
by: David Conorozzo | last post by:
I create a new Access.Application instance. As soon as I refernce the property "References", I am unable to issue a truly successful quit on that instance. By that I mean the call to quit is fine...
2
by: Lauren Quantrell | last post by:
Running Access2000 ADP Project/MSDE on Windows XP... - I Open my Access ADP project. In the Windows Task Manager Processes window MSACCESS.EXE shows up. - I don't do anything else in Access. - I...
3
by: downwitch | last post by:
Greetings, I have an application which has recently gone from being one big piece of front-end code to being three, i.e. an mdb A that references an mda B and an mda C. (For what it's worth, in...
6
by: Max | last post by:
I have the following code on a form that launches Microsoft Outlook and creates a new email message for the user: Outlook.Application oApp = new Outlook.Application(); Outlook.MailItem oMail...
5
by: mzdude | last post by:
I've just started playing with Python. Installed 2.5 on Windows XP system. I'm working through some of the examples in Programming Python 3ed by Mark Lutz. Given the following example when the Quit...
2
by: Alan T | last post by:
private Interop.Word.Application _wordApp; What is the differences betwenn _wordApp.Quit(...) and _wordApp.Application.Quit(...) ?
5
by: Mubs | last post by:
i have the following script.. but i cant get the quit command working... can some1 help quit = n host="$(hostname)" todaysdate="$(date)" lastboot="$(last reboot)" licensinginfo="$(uname...
0
by: Greg Donald | last post by:
When using starttls(), calling quit() throws an exception: -server.quit() (Pdb) n send: 'quit\r\n' sslerror: (8, 'EOF occurred in violation of protocol') For the moment I and catching it...
0
by: Roger | last post by:
I am having a problem sending email through smtp.gmail.com using smtplib. Everything works and the mail is sent and received, except quit. The following shows the problem (without bothering to...
9
by: Andy | last post by:
Just noticed something interesting in the above. If you have your program file set to "Compact on Close" in access 2007 (which is desirable when you have a larger program that frequently needs...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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: 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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...

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.