▲ 651 ▼ functions (lemmy.ml) submitted 9 months ago by cipherd@lemmy.ml to c/programmer_humor@programming.dev 118 comments fedilink hide all child comments cross-posted from: https://lemmy.ml/post/39334581
[–] x00z@lemmy.world 6 points 9 months ago (1 child) function: ... goto function; permalink fedilink source hideshow 2 child comments replies: [–] Ziglin@lemmy.world 2 points 9 months ago (1 child) Or perhaps call function if you've got a call stack going. Nevermind that is C or something right? Otherwise it would be jmp function? permalink fedilink source parent hideshow 2 child comments replies: [–] x00z@lemmy.world 2 points 9 months ago (1 child) Yeah that's C. I added the goto to put emphasis on the function being a label instead of a real function. https://www.geeksforgeeks.org/c/goto-statement-in-c/ permalink fedilink source parent hideshow 2 child comments replies: [–] Ziglin@lemmy.world 1 point 9 months ago (1 child) I've done that in C before. I was just confused because the labels need to be in scope of a function as far as I am aware. In assembly you don't really have that. permalink fedilink source parent hideshow 2 child comments replies: [–] x00z@lemmy.world 1 point 9 months ago We'll just put everything in int main(). No worries permalink fedilink source parent
[–] Ziglin@lemmy.world 2 points 9 months ago (1 child) Or perhaps call function if you've got a call stack going. Nevermind that is C or something right? Otherwise it would be jmp function? permalink fedilink source parent hideshow 2 child comments replies: [–] x00z@lemmy.world 2 points 9 months ago (1 child) Yeah that's C. I added the goto to put emphasis on the function being a label instead of a real function. https://www.geeksforgeeks.org/c/goto-statement-in-c/ permalink fedilink source parent hideshow 2 child comments replies: [–] Ziglin@lemmy.world 1 point 9 months ago (1 child) I've done that in C before. I was just confused because the labels need to be in scope of a function as far as I am aware. In assembly you don't really have that. permalink fedilink source parent hideshow 2 child comments replies: [–] x00z@lemmy.world 1 point 9 months ago We'll just put everything in int main(). No worries permalink fedilink source parent
[–] x00z@lemmy.world 2 points 9 months ago (1 child) Yeah that's C. I added the goto to put emphasis on the function being a label instead of a real function. https://www.geeksforgeeks.org/c/goto-statement-in-c/ permalink fedilink source parent hideshow 2 child comments replies: [–] Ziglin@lemmy.world 1 point 9 months ago (1 child) I've done that in C before. I was just confused because the labels need to be in scope of a function as far as I am aware. In assembly you don't really have that. permalink fedilink source parent hideshow 2 child comments replies: [–] x00z@lemmy.world 1 point 9 months ago We'll just put everything in int main(). No worries permalink fedilink source parent
[–] Ziglin@lemmy.world 1 point 9 months ago (1 child) I've done that in C before. I was just confused because the labels need to be in scope of a function as far as I am aware. In assembly you don't really have that. permalink fedilink source parent hideshow 2 child comments replies: [–] x00z@lemmy.world 1 point 9 months ago We'll just put everything in int main(). No worries permalink fedilink source parent
[–] x00z@lemmy.world 1 point 9 months ago We'll just put everything in int main(). No worries permalink fedilink source parent