GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 19-Jan-2004, 13:40
andrewcarraway andrewcarraway is offline
New Member
 
Join Date: Jan 2004
Posts: 3
andrewcarraway is on a distinguished road

Newbie Question about Borland


Hi, I'm very new to C, so this is probably a stupid question. I've been writing simple programs ("Hello World") and stuff like that. When I run a program I've made a window opens up displaying results but it only stays open for a split second, then closes. How do I make the window stay open so I can see the results?

I'm using Borland C++ 5.02.

thanks,

Andy
  #2  
Old 19-Jan-2004, 14:15
Garth Farley Garth Farley is offline
Invalid Email Address
 
Join Date: May 2002
Location: Ireland
Posts: 638
Garth Farley is a jewel in the roughGarth Farley is a jewel in the roughGarth Farley is a jewel in the rough
This is an OS thing, more than a programming thig. If you double-click the executable, Windows only keeps DOS prompts open while the program is active. If you want to see the output, you've to have a DOS prompt open and run it within it.

So go to Start->Run, type "cmd" (for Win 2k/XP) or "command.com" for others, and cd to the correct directory, and run the program by typing it's name, without the .exe. Bear in mind, it's useful to keep the program & folder names short (<8 chars ideally) to make cd'ing easier!

Another temporary solution is to have the program wait at the very end for your input, have a << cin statement right before exit. Or there is a pause() function in unistd.h, which pauses the program until you force quit it (Ctrl D or Ctrl C, maybe Z, one of them works anyway )

GF
  #3  
Old 21-Jan-2004, 16:14
andrewcarraway andrewcarraway is offline
New Member
 
Join Date: Jan 2004
Posts: 3
andrewcarraway is on a distinguished road
Thanks! The cin works, though I had to include iostream. Thanks again!
  #4  
Old 21-Jan-2004, 16:19
andrewcarraway andrewcarraway is offline
New Member
 
Join Date: Jan 2004
Posts: 3
andrewcarraway is on a distinguished road
This also from another forum worked well too:


#include<conio.h>

insert :

getch();

where you want program to stop
  #5  
Old 24-Jan-2004, 12:17
mak90thug's Avatar
mak90thug mak90thug is offline
New Member
 
Join Date: Jan 2004
Posts: 17
mak90thug is on a distinguished road

Visual Basic is cooler


I don't like Borland C++. I have that one and Visual Basic 6. VS 6 works nicer and is much easier to use. Everything is in GUI format and I don't have to do anything special to create project and such. I have several programs that work well in VS 6, but Borland will choke because it can't open .exe files. I am clueless.

I think I'll stick with one interface for now. I'll come back to Borland when I am a little more experienced.
 
 

Recent GIDBlogPython ebook by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not 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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
total newbie need help grunt123 Apache Web Server Forum 2 04-Dec-2003 12:14
newbie with stupid questions JUNK KED MySQL / PHP Forum 1 16-Oct-2003 09:58
a C input question tmike C Programming Language 1 16-Sep-2003 03:31
a noobish compiler question Charunks C++ Forum 5 03-Sep-2003 03:18
Code problem (a newbie question) monkster87 C++ Forum 3 11-Aug-2003 13:46

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 06:46.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.