c++ - Is everything cleaned up when using 'goto'? -
this question has answer here:
- will using goto leak variables? 1 answer
for (int = 0 ; < 10 ; ++i) { (int j = 0 ; j < 10 ; ++j) { goto label; } } label: // stuff
after goto
i
, j
variables freed? recall goto
doesn't unwind stack or cleanup screw in case?
yeah, gets cleaned up. because c++ frees variables go out of scope.
Comments
Post a Comment