0

What's the difference between for (int i = 0;i < 5; i++) and for (int i=0;i < 5; i++)

Space between verbal name and 0 and the other had no space

20th Oct 2021, 12:45 PM
Mohammed Alimam
Mohammed Alimam - avatar
9 Respostas
+ 2
Mohammed Alimam There is no difference, both will work same. We add space (White Space) just for readability purpose. Compiler will ignore White Space.
20th Oct 2021, 5:44 PM
A͢J
A͢J - avatar
+ 2
Mohammed Alimam I am sure there would be some mistakes in your code. Can you show your code?
20th Oct 2021, 5:59 PM
A͢J
A͢J - avatar
+ 1
So what's the question here ? If you are looking for the difference between the two, then your question description says it all.
20th Oct 2021, 12:48 PM
Arsenic
Arsenic - avatar
0
Beauty it doesn't matter you got the meaning
20th Oct 2021, 12:52 PM
Mohammed Alimam
Mohammed Alimam - avatar
0
Arsenic I mean how c++ read it
20th Oct 2021, 12:54 PM
Mohammed Alimam
Mohammed Alimam - avatar
0
A͢J - S͟o͟l͟o͟H͟e͟l͟p͟e͟r͟ that's what I thought ,but when I was solving ticket office project each one of those gave different results
20th Oct 2021, 5:56 PM
Mohammed Alimam
Mohammed Alimam - avatar
- 1
That's variable not verbal
20th Oct 2021, 12:48 PM
Pariket Thakur
Pariket Thakur - avatar
- 3
Mohammed Alimam c++ doesn't consider those spaces, so both statements are same. The important thing is it must be in single line, you can give any number of space.
20th Oct 2021, 1:48 PM
Arun Ruban SJ
Arun Ruban SJ - avatar