hi there,
do this codes differs? if so which way? what about performance?
Code:type a,b,c,d,e, ........................ , x2, x3, x4...... , y9;Code:type a; type b; type c; . . . . type y9;
hi there,
do this codes differs? if so which way? what about performance?
Code:type a,b,c,d,e, ........................ , x2, x3, x4...... , y9;Code:type a; type b; type c; . . . . type y9;
It is a matter of style, no more. I would use an array with enums as indexes, but that is my style.
Free code: http://sol-biotech.com/code/.
It is not that old programmers are any smarter or code better, it is just that they have made the same stupid mistake so many times that it is second nature to fix it.
--Me, I just made it up
The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man.
--George Bernard Shaw
If "type" is a pointer then there is a difference. You must add the * to each variable you want declared as a pointer under the first scenario.
Right.... There will be no difference in the compiled code.
The 2nd method will allow more space for more-descriptive variable names, or comments (explanations of what the variable are for).
Use whatever method makes the code easier to read & understand.
If you need that many similar variables, it looks like an array (or a few arrays) might be the way to go.... It depends on the program... how the variables are related, etc.