[Solved] What is the difference between declaring an object outside and inside of a loop
When you declare the object inside the loop, a new object will be created on each iteration and the exising one destroyed at the end of each iteration. This is because the object will have a scope inside the {}. When you declare it outside, a single object is created and you work with that, … Read more