using goto with a pointer?

hello, i'm a hobbyist done a few arduino projects, but still confusing with * / &

joe7575 (Joachim Stolberg) · GitHub

I saw this library MOS, seems to use pointers to resume program thats controlled by timer?

but i can't see through the scenes behind the macros.

can anyone provide some kind of easy example, using the same idea, I don't know
pointing to a line?

but not in macro form for understanding?

thank you.

If you really mean that you want to use a goto with a pointer then my advice would be don't do it. In fact don't use goto.

What problem are you aiming to solve by using this library ?

yes,
though there are many ways such as timer interrupt? can do pretty well

I just want to learn different way to controll different functions that's flag/time sensitive,
in case some day i really need to use them,

or to better understand what others programmers wrote

Is your name really:

""

Rule #1: don't use goto
Rule #2: goto Rule #1

:slight_smile:

sorry, not sure it related to firefox 52?
this is what i can only see at profile
"

karma
points

"
with empty information , not sure where to change my nickname to make sense.
call me Alan , if needed. Thank you.

Delta_G:
If you see other programmers using goto, then don't worry about trying to understand it. Those are not smart programmers and not the sort you would want to learn from.

lol, sounds like code racism.

isn't return / break
all some kinda form of GOTO after compiled?
yeah, it's more easy for human to mess it up, then compilers.

okay, is there any chance to declare a pointer/label , changing its address to the line i preferred, while running the program?

or maybe I should just use the library mentioned ?

What problem are you trying to solve by using the library ?

Sometimes trying to learn new tricks in programming is like trying new tricks in your car. Driving over a 250' cliff could be tried. Would you still try it after 3 other car drivers told you it was not a smart choice of tricks to attempt?

So to save time, the next argument will be. OK, try programming with just the letter "Q".

-jim lee

jimLee:
Sometimes trying to learn new tricks in programming is like trying new tricks in your car. Driving over a 250' cliff could be tried. Would you still try it after 3 other car drivers told you it was not a smart choice of tricks to attempt?

So to save time, the next argument will be. OK, try programming with just the letter "Q".

-jim lee

okay, i got your meaning, but what is Q?

UKHeliBob:
What problem are you trying to solve by using the library ?

sorry not to telling,
I had a program working with teensy, with different part as driving LED with SPI,
getting SD data from another SPI,

which works quite fine though, with some of the micros()/wait code

and I'm planning to improve with adding some I2C 6-DOF, RF remote

I guess cutting the program all timer/flag-specific ,like the library could be a way
but possibly with more than 4 functions the library could provide?

yes, I'm also pretty confident that
A static boolean flag and some timer-interrupts could do the same
just preparing more weapons before I use for the battle.
....yeah, does GOTO looks chopsticks?


Should this be on the project guidance?

I saw this library MOS, seems to use pointers to resume program thats controlled by timer?

Whatever problem you are trying to solve by using goto, I suggest a different method.

For one thing (among many) using goto defeats compiler optimization because it can't do "peephole optimization" in code that might be jumped into from somewhere else.

okay, is there any chance to declare a pointer/label , changing its address to the line i preferred, while running the program?

That used to be done in the 1960s in Cobol by the ALTER statement, where you altered where a GOTO went. Let's just say this: Whole programming departments were told not to use ALTER, or else!

Solve your problem another way. If this is anything to do with interrupts you can't change where the interrupt returns to.

You might want to read about state machines.