Hi,
Just a simple question, with a nice opportunity to clean my code ![]()
I'm not sure when I need to use brackets in a for loop, depending on the code that needs to be executed for each iteration.
Example, I have:
for(mat=0;mat<mNrMaterials;++mat)
{
if(materials[mat]) ++mEffect[fx].nrMaterials;
}
Would the result be the same if I use:
for(mat=0;mat<mNrMaterials;++mat) if(materials[mat]) ++mEffect[fx].nrMaterials;
I know that I can leave the brackets out if I just have one line of code for each iteration, like:
for(int i=0;i<5;++i) something[i] = i*2;
Anyone?







