24.01.2017, 16:39
Sizeof is an operator, not a function. It gets evaluated at compile time and has no impact on performance. Use method 1. For a function call use method 2 so the function doesn't get invoked again with every iteration.