G
G-Factor
Hi all
Been learning C++ for about 5 weeks. I find that I create quite a lot of
variables. Generally, is it better to create a new variable for every
different thing that needs to be stored in the program? Or would you reuse
variables in the code... like declare an 'int i', and use it in loops,
storing temp values, storing main variables before you output it to
screen...then put something else in it later if you need an int again.
Thanks
G-Factor.
Been learning C++ for about 5 weeks. I find that I create quite a lot of
variables. Generally, is it better to create a new variable for every
different thing that needs to be stored in the program? Or would you reuse
variables in the code... like declare an 'int i', and use it in loops,
storing temp values, storing main variables before you output it to
screen...then put something else in it later if you need an int again.
Thanks
G-Factor.