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 


How to make a "loop" program in C++?

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
deleted19776
I post too much
Reputation: 11

Joined: 29 Apr 2007
Posts: 3838

PostPosted: Sun Aug 31, 2008 10:49 am    Post subject: How to make a "loop" program in C++? Reply with quote

Hi, i know some VB, so i know this code:
Code:

do
shell.run "C:\Windows\system32\cmd.exe"
loop

Of course you have to create an object called "shell", but i don't wanna do that.
Any way on how to make a loop program in C++?
Back to top
View user's profile Send private message
redhead
Cheater
Reputation: 0

Joined: 21 Mar 2007
Posts: 47

PostPosted: Sun Aug 31, 2008 10:53 am    Post subject: Reply with quote

Code:
while (CONDITION)
{
     CODE;
}

do
{
     CODE;
}while(CONDITION)

int i;
for(i=0;i<9;++i)
{
     CODE;
}
Back to top
View user's profile Send private message
nog_lorp
Grandmaster Cheater
Reputation: 0

Joined: 26 Feb 2006
Posts: 743

PostPosted: Sun Aug 31, 2008 11:28 am    Post subject: Reply with quote

Redhead, in C99 or later (C++ included) you can do
Code:
for(int i = 0; i<9; i++)


Very Happy

_________________
Mutilated lips give a kiss on the wrist of the worm-like tips of tentacles expanding in my mind
I'm fine accepting only fresh brine you can get another drop of this yeah you wish
Back to top
View user's profile Send private message
GMZorita
Grandmaster Cheater Supreme
Reputation: 0

Joined: 21 Mar 2007
Posts: 1361

PostPosted: Sun Aug 31, 2008 12:27 pm    Post subject: Reply with quote

If you want to do a infinite loop use
Code:

for(;;)
{
         "Your Code here"
}

I suggest you to add the Sleep function for non-100% CPU usage.

_________________
Gone
Back to top
View user's profile Send private message
deleted19776
I post too much
Reputation: 11

Joined: 29 Apr 2007
Posts: 3838

PostPosted: Sun Aug 31, 2008 12:34 pm    Post subject: Reply with quote

GMZorita wrote:
If you want to do a infinite loop use
Code:

for(;;)
{
         "Your Code here"
}

I suggest you to add the Sleep function for non-100% CPU usage.

It's supposed to be a crash your computer script.
Otherwize known as a fork bomb.
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sun Aug 31, 2008 12:54 pm    Post subject: Reply with quote

As retarded as this is, use CreateProcess.

You can figure out the rest on your own, I'm sure. Locked.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    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