Let's say I have some c++ code:
if (error)
goto exit;
...
// size_t i = 0; //error
size_t i;
i = 0;
...
exit:
...
I understand we should not use goto
, but still why does
size_t i;
i = 0;
compile whereas size_t i = 0;
doesn't?
Why is such behavior enforced by the standard (mentioned by @SingerOfTheFall)?