Variable Sized Arrays

  • + 0 comments

    Yes, you can take 'int k' and 'int data' out of the for loops and declare them outside. This is for scoping purpose (that is, to be 'defensive' in programming). This is just in case there is a 'k' somewhere else in the code too. The 'k' or 'data' inside the for loops will be different from those elsewhere.