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 


[C/C++/C#]Question in programming

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Vibrate
How do I cheat?
Reputation: 0

Joined: 04 May 2013
Posts: 1

PostPosted: Mon Apr 21, 2014 3:13 pm    Post subject: [C/C++/C#]Question in programming Reply with quote

Hello,
I am a new member so please no offense.
Does it matter if i do this:
1. int i;
2. for(i = 0; i < 10; i++)
3. {
expression
}

so does it matter if the 1. number would be this or this:
int i = 0;
OR
int i;

Does it matter?

Thank you!
Back to top
View user's profile Send private message
justa_dude
Grandmaster Cheater
Reputation: 23

Joined: 29 Jun 2010
Posts: 893

PostPosted: Mon Apr 21, 2014 7:11 pm    Post subject: Re: [C/C++/C#]Question in programming Reply with quote

Vibrate wrote:
Hello,
I am a new member so please no offense.
Does it matter if i do this:
1. int i;
2. for(i = 0; i < 10; i++)
3. {
expression
}

so does it matter if the 1. number would be this or this:
int i = 0;
OR
int i;

Does it matter?

Thank you!


Doesn't matter, since you're initializing i twice - once at instantiation and once when you setup your loop. In modern C++, it's common to use a "for(int i=0;..." form, so that i is scope-limited to the loop. The theory is that it makes your program more resilient to later updates.

_________________
A nagy kapu mellett, mindig van egy kis kapu.
----------------------
Come on...
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