Follow us on Twitter!
Few are those who can see with their own eyes and hear with their own hearts. - Albert Einstein
Thursday, April 24, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 22
Guests Online: 19
Members Online: 3

Registered Members: 82897
Newest Member: salim
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

.exe command problem


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 25-08-06 08:47
In some .exe if there is a cmd popup without input it will just pop up and disappear not displaying anything, but as i leave c++ it became an issue to me making beginner programs. Even with input i will input it and the output will popup and the command prompt will dissapear.

specs-
149gb hdd
os- winxp
im using dev C++ to compile

if you need anymore specs just say so and i can get em


Author

RE: .exe command problem


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 25-08-06 10:23
Try adding the line:

Code
system("pause");




to the end of your program, right before the return 0; , that will make the program display "Press any key to continue" and will wait for you to press a key before ending.

You could also run the program from the CMD prompt instead of double-clicking the file in explorer.




Edited by on 25-08-06 10:23
Author

RE: .exe command problem


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 25-08-06 11:18
Yehr while youre still beginning to learn the language, Id recommend running most of ur programs from the cmd prompt.


Author

RE: .exe command problem


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 25-08-06 11:18
just use getchar(); before return 0;

and if you won't want to add some lines, just run it under cmd prompt like they said.

Or you add <windows.h> and use the messagebox api for your output and be a l33t win32 coding ninja :ninja:

i wouldn't go for system cause that requires another header.


Author

RE: .exe command problem


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 25-08-06 11:27
open the .exe file with cmd


Author

RE: .exe command problem

Ingelo
Member



Posts: 58
Location: Denmark
Joined: 09.05.06
Rank:
Newbie
Warn Level: 5
Posted on 25-08-06 13:14
mastergamer wrote:
Try adding the line:

Code
system("pause");




I would rather use
Code
cin.get();





felipnorwoodthe007.googlepages.com/ingelo.png
Thansk for the sig chaunchothenacho :)
img262.imageshack.us/img262/327/amdgy3.gif
img105.imageshack.us/img105/3802/gmailxg6.png


Edited by Ingelo on 25-08-06 13:15
Ingelo@ofir.dk NoNe http://www.outofreality.dk/Test/rot47.php
Author

RE: .exe command problem


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 25-08-06 19:38
well right now i just compile the programs but i could try running from the cmd, but is there anyway to fix this for other causes like installations, id just rather nit have the cmd pop up and go away, id like to know what its doing.


Author

RE: .exe command problem

n30
Member

Your avatar

Posts: 49
Location: USA
Joined: 18.08.06
Rank:
Wiseman
Posted on 25-08-06 21:06
try adding the "system pause" at every other line if all else fails. Do it only for debugging. Don't use "system pause" in your final version, because it requires an extra header, and not all OSs support it.


<Insert sig here>
Author

RE: .exe command problem


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 25-08-06 22:19
ok i tried opening just from the cmd prompt and it works fine, if needed ill use system pause


Author

RE: .exe command problem


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 27-08-06 22:40
As pointless as this post is, I'd just like to point out Anarcho's hypocritical suggestion =P.

I wouldn't use system(); though because that requires another header


You could include <windows.h> and use MessageBox() and be a l33t win32 ninja