If you output the value is 150
If you output to , you will get a value of 6300.
The difference is whether you put a value when you first declare a variable or a value in a for statement, so I looked it up on the Internet and I think it's the difference between initialization and substitution, but I don't understand it clearly, so I'm writing it down here. I don't know much yet, so please take good care of me.c++ c initialization
It wouldn't be much different from a computer's point of view. But there's a big difference from the perspective of a programmer who looks at the code.
I understand that the former was written like that because the old C language did not support grammar. I don't understand that the result is different. I think something else is wrong.
There's a big difference in readability. If you write code like the former, I think they'll ask if you're making it up on purpose.
© 2022 pinfo. All rights reserved.