Valhalla Legends Forums Archive | General Programming | new at c++

AuthorMessageTime
starshake111
how do i change some thing when im working in a c++ source file then run the .exe it like pretty much closes right when i open it ? and how do i keep it from saying 'press any key to continue'
December 12, 2002, 5:40 PM
Zakath
When I was first starting out, I used an otherwise-meaningless call to getch() to hold up program termination until I was ready for it...

Btw, this isn't really bot-related. You should have posted in the general programming forum.
December 12, 2002, 7:28 PM
iago.
You can also #include <stdio.h> and at the bottom put in a system("pause") (on pc).

If you're on linux, it's all good since it runs in terminal anyway and you wouldn't have that problem.

If you're on mac, get a real computer.
December 13, 2002, 2:24 PM
Nova1313
you missed something...

what if your mac runs linux :p

Oh yeah and OS X is based on Bsd so it's unix ish you can get a terminal and run stuff so again you shouldn't have trouble... unless you have os9 then i have to agree get a real computer.
December 24, 2002, 7:51 PM
iago
If there's a picture of an apple anywhere on the computer the it's garbage.. sorry :P
December 26, 2002, 3:30 AM
Etheran
mmmm apple.
December 26, 2002, 7:20 AM
Necrosis
int endme;
cout << "\nPress any key";
cin >> endme;
December 31, 2002, 8:15 PM
Feruk
Haha OMG in all my time programming, I never thought of doing something as easy as easy as what Necrosis suggested. By the way, it would work a little different since the user would also have to press enter.
December 31, 2002, 8:18 PM
Zakath
I still prefer getch().

[code]printf( "Press any key to terminate" );
getch();
return 0;
[/code]
December 31, 2002, 8:38 PM
Eibro
Too bad getch is non-standard.
You could get the best of both worlds (not having to press enter + standard function) with cin.get();
January 1, 2003, 3:47 AM
Skywing
[code]
getc(stdin); // this will work and it's standard!
[/code]
January 1, 2003, 4:07 AM
MesiaH
[quote]

Btw, this isn't really bot-related. You should have posted in the general programming forum.[/quote]

This is the general programming forum lol
January 1, 2003, 10:56 PM
Skywing
[quote]

This is the general programming forum lol[/quote]
Probably because someone moved the topic...
January 1, 2003, 11:20 PM
Zakath
[quote]
Probably because someone moved the topic...[/quote]

Indeed.
January 3, 2003, 11:10 PM

Search