J
John Doe
Let's say I had code like these, what is better?
for(;
{
bool finished;
do
{
}
while (!finished);
}
or
bool finished;
for(;
{
do
{
}
while (!finished);
}
Whenever declaring variables I tend to think like what a compiler does.
What if a compiler allocates from the stack whenever it finds a variable
definition?
for(;
{
bool finished;
do
{
}
while (!finished);
}
or
bool finished;
for(;
{
do
{
}
while (!finished);
}
Whenever declaring variables I tend to think like what a compiler does.
What if a compiler allocates from the stack whenever it finds a variable
definition?