473,395 Members | 1,681 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,395 software developers and data experts.

DOS Window

vj
Hi all,
I am a novice user of C++. I am using Borland c++ builder 5.
When I run a program, a DOS window appears where output of the program
(if intended) is displayed. When the program finishes, this window
closes automatically. I want this window to stay there even after the
program finishes. How can it be done?

Thanks in advance.

Nov 22 '05 #1
7 1412
vj wrote:
Hi all,
I am a novice user of C++. I am using Borland c++ builder 5.
When I run a program, a DOS window appears where output of the program
(if intended) is displayed. When the program finishes, this window
closes automatically. I want this window to stay there even after the
program finishes. How can it be done?

Thanks in advance.


adding something like getch() or getchar() or system("PAUSE") as the
last statement in "main()" should work.

Nov 22 '05 #2
Neelesh Bodas wrote:
adding something like getch() or getchar() or system("PAUSE") as the
last statement in "main()" should work.


And since this won't work if you call the exit() function, you might want to
take a look at atexit(), although this is C specific... Do we talk about
cstdlib stuff here? :) I never know...

Arne

--
[--- PGP key FD05BED7 --- http://www.root42.de/ ---]
Nov 22 '05 #3
Arne Schmitz wrote:
Neelesh Bodas wrote:
you might want to take a look at atexit(), although this is C specific...


atexit() is equally good with C++. The standard requires that cstdlib
implement atexit() , abort() and exit().

17.4.1.3 - 13 : "The supplied version of the header <cstdlib> shall
declare at least the functions abort(), atexit(), and exit()"

Nov 22 '05 #4
On 2005-11-17 19:18, vj wrote:
Hi all,
I am a novice user of C++. I am using Borland c++ builder 5.
When I run a program, a DOS window appears where output of the program
(if intended) is displayed. When the program finishes, this window
closes automatically. I want this window to stay there even after the
program finishes. How can it be done?

Thanks in advance.


You might want to consult the documentation, there might be some way to
prevent the window from closing (in Visual Studio you can use Ctrl+F5
instead of just F5). Or you could run your application from the Command
Prompt.

Erik Wikström
--
"I have always wished for my computer to be as easy to use as my
telephone; my wish has come true because I can no longer figure
out how to use my telephone" -- Bjarne Stroustrup
Nov 22 '05 #5
add Readln() at end
"vj" <ee***@nottingham.ac.uk>
??????:11**********************@g44g2000cwa.google groups.com...
Hi all,
I am a novice user of C++. I am using Borland c++ builder 5.
When I run a program, a DOS window appears where output of the program
(if intended) is displayed. When the program finishes, this window
closes automatically. I want this window to stay there even after the
program finishes. How can it be done?

Thanks in advance.

Nov 22 '05 #6
vj
Thankyou for all your suggestions.
If I use the command prompt, what is the command to make an .exe file
from the source code (.cpp file)?

Nov 22 '05 #7
On 18 Nov 2005 23:39:08 -0800, "vj" <ee***@nottingham.ac.uk> wrote:
Thankyou for all your suggestions.
If I use the command prompt, what is the command to make an .exe file
from the source code (.cpp file)?


It's in your compiler manual/documentation. You will need to be able
to read this sort of literature as a programmer.
Nov 22 '05 #8

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

Similar topics

5
by: Carol Lyn | last post by:
Could use your assistance with this. I have a window that opens via onclick and it is a small window with info about a site. If the user is interested in visiting that site, there is a link to...
2
by: Juan Garcia | last post by:
Subject says it all. Given: Window A with text field. Window B with a button (onClick opens Window C) Window C with a button (onClick I want it to modify text fields of Window A) I have...
6
by: David Hayes | last post by:
juglesh <juglesh@nospamRadioKDUG.com> wrote in "Re: how to maximize the browser window that fits the monitor size?" (Saturday, January 01, 2005 3:12 AM): > > >I want to maximize the browser...
19
by: Darren | last post by:
I have a page that opens a popup window and within the window, some databse info is submitted and the window closes. It then refreshes the original window using window.opener.location.reload(). ...
14
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a...
1
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at...
26
by: yb | last post by:
Hi, Is there a standard for the global 'window' object in browsers? For example, it supports methods such as setInterval and clearInterval, and several others. I know that w3c standardized...
4
by: alexandre.brisebois | last post by:
Hi, I am using access 2003, I would like to know if there is an option to reorganize the tables in a maner that is readable, as we can do in sql sever 2000 or 2005. I have been given a database...
5
by: asadhkhan | last post by:
I have the following code which works correctly in IE 6, but in IE 7, Fire Fox 2.0 and Netscape 8 it does not work. I have a main page where a button calls this pop-up and uploads a file once you...
24
by: Jeremy J Starcher | last post by:
While reading c.l.j, I've noticed that some people prefer and indeed even recommend the use of "window.alert()" over "alert()". I can't find any technical reason to make this distinction, and...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...

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.