|
|
|
|
|
by jerf
534 days ago
|
|
"You can still go crazy and jump into the middle of scopes with uninitialized variables." It is difficult when speaking across languages, but in many cases, no, you can't. https://go.dev/play/p/v8vljT91Rkr C isn't a modern language by this standard, and to the extent that C++ maintains compatibility with it (smoothing over a lot of details of what that means), neither is it. Modern languages with goto do not generally let you skip into blocks or jump over initializations (depending on the degree to which it cares about them). The more modern the language, generally the more thoroughly tamed the goto is. |
|
However if y is changed to 'INT y = x + 2;', essentially a "constant", then there is no runtime error: