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 


[Help]C/C++

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Itachi08
Expert Cheater
Reputation: 0

Joined: 03 Nov 2006
Posts: 101

PostPosted: Sat Jul 28, 2007 3:48 am    Post subject: [Help]C/C++ Reply with quote

my problem is whenever i compile a program in c or c++ i open the .exe
and lets say for example a program that outputs "Hello world"
and it opens for less than a second and it closes..
in C++ i have a solution by writing system("PAUSE"); but i just started learning C and i don't know how to fix this..
can anyone help?

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

Joined: 22 Jul 2006
Posts: 666

PostPosted: Sat Jul 28, 2007 6:12 am    Post subject: Reply with quote

Call the function getch at the end.
_________________

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
Itachi08
Expert Cheater
Reputation: 0

Joined: 03 Nov 2006
Posts: 101

PostPosted: Sat Jul 28, 2007 7:35 am    Post subject: Reply with quote

k thx
_________________


Last edited by Itachi08 on Sat Jul 28, 2007 8:31 am; edited 1 time in total
Back to top
View user's profile Send private message
the_undead
Expert Cheater
Reputation: 1

Joined: 12 Nov 2006
Posts: 235
Location: Johannesburg, South Africa

PostPosted: Sat Jul 28, 2007 7:41 am    Post subject: Reply with quote

getch()
_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sat Jul 28, 2007 10:09 am    Post subject: Reply with quote

try

Code:
#include <stdlib.h>

//coding
system("pause>nul");


not sure if its just for C++ or not

but it stops the program till u press a button, but doesnt say anything unlike

system("pause");

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

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Sat Jul 28, 2007 10:19 am    Post subject: Reply with quote

don't do that, instead, do

Code:

_getch();


e: ok


Last edited by appalsap on Sat Jul 28, 2007 10:58 am; edited 1 time in total
Back to top
View user's profile Send private message
Jani
Grandmaster Cheater
Reputation: 2

Joined: 29 Dec 2006
Posts: 804

PostPosted: Sat Jul 28, 2007 10:57 am    Post subject: Reply with quote

getch() is declared deprecated. Use _getch() instead of it.
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Sat Jul 28, 2007 11:54 am    Post subject: Reply with quote

Code:
#include "stdio.h"

int main()
{
     printf("Hello World\n");
     scanf(0);
     return 0;
}


Thats really shit and fucks up. But i cant post someting already posted can i?
Back to top
View user's profile Send private message MSN Messenger
DeltaFlyer
Grandmaster Cheater
Reputation: 0

Joined: 22 Jul 2006
Posts: 666

PostPosted: Sat Jul 28, 2007 12:14 pm    Post subject: Reply with quote

You could always post getchar.
_________________

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
Itachi08
Expert Cheater
Reputation: 0

Joined: 03 Nov 2006
Posts: 101

PostPosted: Sat Jul 28, 2007 1:46 pm    Post subject: Reply with quote

I use dev c++ and when i do getch() it has error when i compile
_________________
Back to top
View user's profile Send private message
UnLmtD
Grandmaster Cheater
Reputation: 0

Joined: 13 Mar 2007
Posts: 894
Location: Canada

PostPosted: Sat Jul 28, 2007 1:51 pm    Post subject: Reply with quote

you need to include conio.h
_________________
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