473,473 Members | 1,920 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

incrementation dans for-loop

84 New Member
what is the difference between
Expand|Select|Wrap|Line Numbers
  1. for(j=0;j<cl.ts[0]->size();++j){
  2. double l=cmbcalc->j2l[j];
  3. }
  4.  
and

Expand|Select|Wrap|Line Numbers
  1. for(j=0;j<cl.ts[0]->size();j++){
  2. double l=cmbcalc->j2l[j];
  3. }
  4.  
?

I know that usually it means when the incrementation is made, in the sense that
Expand|Select|Wrap|Line Numbers
  1.  
  2. x=10;
  3. y=++x;
  4.  
gives x=10 and y=11
while
Expand|Select|Wrap|Line Numbers
  1. x=10;
  2. y=x++;
  3.  
gives x=10=y. But what does it change in a for-loop?
Oct 25 '07 #1
2 1347
Banfa
9,065 Recognized Expert Moderator Expert
gives x=10=y. But what does it change in a for-loop?
Nothing, the 2 for loop implementations are functionally identical. It would only have an effect if the e3rd expresion in the for loop where more complex such that it was dependent, as an expression, on j being pre or post incremented.
Oct 25 '07 #2
sanctus
84 New Member
Nothing, the 2 for loop implementations are functionally identical. It would only have an effect if the e3rd expresion in the for loop where more complex such that it was dependent, as an expression, on j being pre or post incremented.
thanks very much for your help.
Oct 25 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Agathe | last post by:
Bonjour, Je souhaite insérer dans une table MySQL des données provenant d'un fichier texte grâce à un script PHP. Mon fichier porte l'extension "txt" et les données sont séparées par des ";'. ...
3
by: Raymond H. | last post by:
Bonjour, Est-il possible d'exécuter seulement un msgbox dans l'événement clik d'une ToolBar mais sans que le bouton en question (de la ToolBar) ne s'enfonce mais reste normal sans enfoncement ?...
2
by: Michael B. | last post by:
Hi! I have a very simple question: Is it still true that pre variable incrementation (like ++i) is faster than post incrementation (i++). I heard that in modern compilers it makes no difference...
2
by: Amoula100 | last post by:
Bonjour Je veux pouvoir gontrôler la navigation dans les tables enfants dans ma DataGrid, c'est à dire je veux acceder aux données de la table enfant pour des lignes spécifiques et pas pour...
3
by: Prometheum | last post by:
Having read over some of the disscussions involving incrementing variable names in C++, I have the impression that it's impossible. Is that true? I have a very definite need for them in the following...
4
by: sam | last post by:
hI, I am little confused here See i have int wordlen=10; when int s is array s++; whats the meaning of this
2
by: eBob.com | last post by:
I'd like my progress bar to increment by a minimal amount for each item processed, so that it would increment steadily and gradually. As I read the doc I think that the code below should do it. ...
5
by: troy_lee | last post by:
I have a table that has a PK field with the following format: Dyymm123. So that, a typical number might look like this D0806270. The first character is literal and never changes. The next four...
4
by: HansWernerMarschke | last post by:
I hate pointers. I want to copy something from one memory position to another memory position. Both strings overlap. // The rotor type typedef struct { int wheel_number; char *wheel; char...
6
Dormilich
by: Dormilich | last post by:
Hi, I’ve got a mathematical script, which is currently running fine*, although it bothers me that JS does not always increment correctly. sometimes it happens that the incremented value is...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.