1
for (int i = 0 ; i < 10 ; ++i)
{
    for (int j = 0 ; j < 10 ; ++j)
    {
        goto label;
    }
}
label:
// stuff

After goto will the i and j variables get freed? From what I recall goto doesn't unwind the stack or do any cleanup so will it screw something up in this case?

4

1 回答 1

3

是的,它会被清理干净。因为 C++ 释放了超出范围的变量。

于 2013-08-07T10:36:40.430 回答