1,076 questions
0
votes
3
answers
144
views
How does GO TO influence the control flow
I am new to COBOL/Mainframes in general, I am just looking into the legacy code and trying to understand the control flow. Can you please explain how GO TO influence the control flow in the below ...
5
votes
2
answers
423
views
Why are gotos allowed to jump initialisation in C but not C++?
Consider this code:
int foo() {
goto lbl;
int a = 4;
lbl:
return 5;
}
With GCC 12, this compiles totally fine as C, not even a warning. However if I try to compile it as C++ I get this ...
0
votes
0
answers
57
views
App start by debugger cannot trigger 'goto source code' by spawn code.exe
VS Code Version:
Version: 1.103.2 (user setup)
Commit: 6f17636121051a53c88d3e605c491d22af2ba755
Date: 2025-08-20T16:45:34.255Z
Electron: 37.2.3
ElectronBuildId: 12035395
Chromium: 138.0.7204.100
Node....
7
votes
2
answers
189
views
strictly speaking, where does the scope of a label name starts and ends in C?
In C17's final draft N2176 document,
at 1st paragraph of 6.2.1, it defines a label name as a type of identifier,
at 3rd paragraph of 6.2.1, it says
A label name is the only kind of identifier that ...
0
votes
2
answers
84
views
BAT script to check for multiple files individually else goto 1, 2, etc
I need to be able to check the Public Desktop for file1*, then, if found, exit normally. If file1* is not found, I need it to check for file2*, then, if found, exit normally. If neither file is found, ...
0
votes
3
answers
161
views
Is there an better/efficient way to keep asking for user input from STDIN using fgets() in C?
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAXSIZE 10
int main(int argc, char *argv[]){
char input[MAXSIZE], c, *input_ptr;
input_tag: printf("...
2
votes
1
answer
160
views
Migrating from BASIC to Rust, what do I do with On Gosub?
Most BASIC to Rust code is straightforward. However, what do I do with On Gosub? My brief is to use identical code constructs wherever possible.
Here is the BASIC code (reduced to the minimum).
choice ...
0
votes
1
answer
75
views
How to use 'goto' in gopher-lua v1.1.0?
How to use 'goto' in gopher-lua v1.1.0? Is seems that gopher-lua has already support 'goto' over v1.1.0 link
I have already update gopher-lua's version in v1.1.0. But when I use goto goto and ::label::...
3
votes
1
answer
118
views
Why does `void *p = &&aa;` compile even when the code for label `aa` is optimized away due to a `goto` statement?
In C language, I want to obtain the address of a label, and I found the following method:
https://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html
However, due to the presence of a goto statement in ...
1
vote
1
answer
45
views
Converting FOCAL to language without GOTO: can an "if" statement with multiple GOTO be parsed algorithmically?
I know that I can translate simple GOTO inside a for or while loop by using if/else or break statements. My question is about trying to write a 'translator' function which automatically converts ...
-1
votes
1
answer
464
views
What is the Microsoft goto extension? [closed]
I am writing a C++ generator, that needs to use the goto statement. I am compiling my code with clang++ and get the warning [-Wmicrosoft-goto] on some of my gotos. All of my gotos only jump around ...
6
votes
1
answer
263
views
Can Knuth's "Algorithm B" for Queens puzzle be written without goto statements or recursion?
Though I'm aware of the basic recursive N queens solution, I'm trying to learn more about backtracking by studying and implementing Knuth's "Algorithm B (Basic backtrack)" for the case of ...
-1
votes
1
answer
53
views
What is the best way to have different entry points for a list of iterative commands?
I have a list of iterative Python commands:
def command_list(start_at):
step1
step2
step3
# ...
stepN
Now I want to start_at different steps in this list of commands and then ...
2
votes
1
answer
167
views
C# Best way to break out of multiple nested functions with high performance
*Sorry, I will continuously edit my article to make my description clearer to express my question.
This may also cause some inconvenience.
I have an automation program used to control other ...
3
votes
1
answer
507
views
GCC "labels as values" – intended usage
I recently heard about the Labels as Values extension to C/C++ in GCC and other compilers. I was thinking about how I'd use that to write a threaded interpreter (where a virtual machine program is ...