home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Join TechIMO for Free!
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
Reply Get bargains at  »  Dealighted.com
 
Thread Tools
Currently Active Users: 1693
Discussions: 188,401, Posts: 2,243,608, Members: 232,631
Old October 3rd, 2005, 12:27 AM   Digg it!   #1 (permalink)
Member
 
izaic3's Avatar
 
Join Date: Mar 2004
Posts: 390
Blog Entries: 1
DOS window likes to hide!

Well, here is my problem. Whenever I write simple batch files, or for example right now the hello world C++ program, and then open them, the dos window opens for about 1/16th of a second, and then exits. This is without any input on my part. Is there a way to prevent this? Or to at least make it stay up longer? Thanks in advance.
__________________
Legalize the Constitution. Ron Paul 2008.

izaic3 is offline   Reply With Quote
Old October 3rd, 2005, 09:50 AM     #2 (permalink)
Banned
 
Iturea's Avatar
 
Join Date: Jan 2004
Location: Earth
Posts: 420
Smile

You can throw a cin after the out put and make it to where if the user enters x then the program closes or something to that sort.

There is also a function out there in many C++ libraries that will pause the output. I think it is simply pause(); or just plain pause;

You can also run the program in debug mode in most IDE's and it will keep the window open.

Hope that helps

Iturea is offline   Reply With Quote
Old October 3rd, 2005, 10:40 AM     #3 (permalink)
Perfetc Member
 
VHockey86's Avatar
 
Join Date: Jan 2003
Location: Maryland Suburbia
Posts: 4,327
Start up a command prompt and launch the program from there, rather than just double clicking on the executable/batch file. By default the command prompt closes when the program is done, but if the command prompt existed to begin with, it will remain after program execution.

VHockey86 is offline   Reply With Quote
Old October 3rd, 2005, 11:17 AM     #4 (permalink)
where's fargo?
 
bombledmonk's Avatar
 
Join Date: Aug 2003
Location: Fargo-NDSU from MN
Posts: 3,383
you can add

system ("pause");

at the end of the main fuction
__________________
Team Fortress Classic
bombledmonk is offline   Reply With Quote
Old October 5th, 2005, 12:28 AM     #5 (permalink)
Member
 
izaic3's Avatar
 
Join Date: Mar 2004
Posts: 390
Blog Entries: 1
Thanks for the tips!
izaic3 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Minimize Dos window to Tray? joker_927 Applications and Operating Systems 3 January 25th, 2005 10:05 PM
Whether or not McDonald's likes it, Theophylact IMO Community 6 November 11th, 2003 11:12 PM
Dos window in Win XP lobo_pac General Tech Discussion 3 July 14th, 2003 09:36 PM
HOW TO MAXIMIXE THE WINDOW OF A DOS PROGRAM carmacamin Technical Support 4 January 21st, 2003 09:30 PM
Who likes to travel ?? john80y IMO Community 6 April 27th, 2002 02:24 PM

Most Active Discussions
Is It Just Me? (2906)
3-days in and no threads about Gaza (161)
Unarmed man on his stomach shot by .. (6)
New Build ( Finally ) (7)
CPU wont boot (7)
Building a gaming computer advice (5)
I think I just killed my computer w.. (24)
RCA 52Inch HDTV wont turn on (5)
Folderchat Weekday thread (444)
Recent Discussions
Laptop proccesor to desktop mob.. (2)
Please help! multiple problems! (4)
RCA 52Inch HDTV wont turn on (5)
New Build ( Finally ) (7)
Common Spyware Solutions (97)
How do you move a hard-drive to.. (4)
What is the best external enclo.. (0)
Partition Magic 7.0 (Unallocate.. (17)
For cheap price and good qualit.. (1)
Blackberry Storm, Gears of War .. (1)
Core 2 Quad Q9550 system (3)
COWBOOM Ripoff! Used Laptop w/$.. (4)


All times are GMT -4. The time now is 04:09 AM.
TechIMO Copyright 2008 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28