I've produced a minimum reproducible example of my problem:
#include <iostream>
void Func()
{
static int i = 0;
for (i; i < 5; i++)
{
std::cout << i << "\n";
return;
}
}
int main()
{
Func();
Func();
Func();
}
The output from this is "0", "0", "0". I want it to output "0", "1", "2". How do I achieve this?