• Welcome to Valhalla Legends Archive.
 

new at c++

Started by starshake111, December 12, 2002, 11:40 AM

Previous topic - Next topic

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'

Zakath

#1
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.
Quote from: iago on February 02, 2005, 03:07 PM
Yes, you can't have everybody...contributing to the main source repository.  That would be stupid and create chaos.

Opensource projects...would be dumb.

iago.

#2
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.

Nova1313

#3
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.

iago

#4
If there's a picture of an apple anywhere on the computer the it's garbage.. sorry :P
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Etheran

#5
mmmm apple.

Necrosis

#6
int endme;
cout << "\nPress any key";
cin >> endme;

Feruk

#7
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.

Zakath

#8
I still prefer getch().

printf( "Press any key to terminate" );
getch();
return 0;
Quote from: iago on February 02, 2005, 03:07 PM
Yes, you can't have everybody...contributing to the main source repository.  That would be stupid and create chaos.

Opensource projects...would be dumb.

Eibro

#9
Too bad getch is non-standard.
You could get the best of both worlds (not having to press enter + standard function) with cin.get();
Eibro of Yeti Lovers.

Skywing

getc(stdin); // this will work and it's standard!

Mesiah / haiseM

#11
QuoteBtw, this isn't really bot-related. You should have posted in the general programming forum.

This is the general programming forum lol
]HighBrow Innovations
Coming soon...

AIM Online Status: 

Skywing

#12
QuoteThis is the general programming forum lol
Probably because someone moved the topic...

Zakath

#13
QuoteProbably because someone moved the topic...

Indeed.
Quote from: iago on February 02, 2005, 03:07 PM
Yes, you can't have everybody...contributing to the main source repository.  That would be stupid and create chaos.

Opensource projects...would be dumb.