Cipherd@lemmy.ml to Programmer Humor@programming.dev · 21 hours agofunctionslemmy.mlimagemessage-square78fedilinkarrow-up1476arrow-down17file-textcross-posted to: programmerhumor@lemmy.ml
arrow-up1469arrow-down1imagefunctionslemmy.mlCipherd@lemmy.ml to Programmer Humor@programming.dev · 21 hours agomessage-square78fedilinkfile-textcross-posted to: programmerhumor@lemmy.ml
minus-squareZiglin (it/they)@lemmy.worldlinkfedilinkEnglisharrow-up2·16 hours agoOr perhaps call function if you’ve got a call stack going. Nevermind that is C or something right? Otherwise it would be jmp function?
minus-squarex00z@lemmy.worldlinkfedilinkEnglisharrow-up2·13 hours agoYeah 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/
minus-squareZiglin (it/they)@lemmy.worldlinkfedilinkEnglisharrow-up1·6 hours agoI’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.
minus-squarex00z@lemmy.worldlinkfedilinkEnglisharrow-up1·3 hours agoWe’ll just put everything in int main(). No worries
function: ... goto function;Or perhaps
call functionif you’ve got a call stack going.Nevermind that is C or something right? Otherwise it would be
jmp function?Yeah that’s C.
I added the
gototo put emphasis on the function being a label instead of a real function.https://www.geeksforgeeks.org/c/goto-statement-in-c/
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.
We’ll just put everything in
int main(). No worries