What are you trying to accomplish?
If you are trying to access a variable ioutside the loop for, you will have to declare it outside the loop for:
int i;
for(i = 0; ; )
{
…
}
printf("%d\n", i);
If you want the loop to be forexecuted only the first time the function is called, create a staticboolean variable to handle it.
static bool firstTime = true;
if(firstTime)
{
for(int i = 0; ; )
{
…
}
firstTime = false;
}
source
share