Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


System("PAUSE") over cin.get();

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Tue Jul 31, 2007 8:29 pm    Post subject: System("PAUSE") over cin.get(); Reply with quote

well many many people in c++ use System("PAUSE") or w/e to halt there program until you press a key, heres why you shouldn't use it...

it only works on windows or dos

you have to link to another header (stdio.h) instead of a native iostream.h code

so use this function now, i like it more

cin.get();

this requires no more linking and doesnt call the OS

it waits until return is pressed then continues the program Very Happy

_________________
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Tue Jul 31, 2007 8:42 pm    Post subject: Reply with quote

_getch() best emulates system("PAUSE") because it returns after one keypress
Back to top
View user's profile Send private message
DeltaFlyer
Grandmaster Cheater
Reputation: 0

Joined: 22 Jul 2006
Posts: 666

PostPosted: Tue Jul 31, 2007 8:45 pm    Post subject: Re: System("PAUSE") over cin.get(); Reply with quote

blankrider wrote:
it only works on windows or dos

Most likely you won't write a program for another platform, especially with all your love for Win32 API.

blankrider wrote:
you have to link to another header (stdio.h) instead of a native iostream.h code

Stdio is the standard C header compared to iostream which is a C++ only header.

_________________

Wow.... still working at 827... what's INCA thinking?
zomg l33t hax at this place (IE only). Over 150 people have used it, what are YOU waiting for?
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Tue Jul 31, 2007 9:03 pm    Post subject: Reply with quote

cin.get() ftw...
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Tue Jul 31, 2007 9:11 pm    Post subject: Reply with quote

it helps if you put

cin.ignore();

in the line before it, i was running into issues with it skipping cin.get() after i entered a value

_________________
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Tue Jul 31, 2007 9:20 pm    Post subject: Reply with quote

i use cin.ignore() as well
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Wed Aug 01, 2007 7:45 am    Post subject: Reply with quote

system("pause") doesnt require stdio...... it only requires iostream....

system("pause>nul") is basically the same thing as _getch() but it requires stdlib.h

the rest are all good....

_________________
Back to top
View user's profile Send private message
UnLmtD
Grandmaster Cheater
Reputation: 0

Joined: 13 Mar 2007
Posts: 894
Location: Canada

PostPosted: Wed Aug 01, 2007 10:35 am    Post subject: Reply with quote

But using system(XXX); is not safe.
_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites