For loop control variable gets assigned with empty string in second iteration onwards I have following C++ snippet: