0
goofle
7y

Do declare all the variables you're going to need at beginning of the function, or right before you're going to need/initialize it? What do you prefer.

Comments
  • 4
    General variables at the beginning, quick ones for temporary stuff right when I need then
  • 0
    I tend to do it at the beginning, but most inputs are function arguments anyway, so it's not like it makes much of a difference.
  • 1
    In C you used to only be able to declare variables at the beginning of a block. I think some people are just holding on to traditions to be honest.
Add Comment