Temporary command?

is it possible to make a temp command? so for example if i inserted a word for example "Checkpoint" would it be possible to make the program create a line of code that allowed to me go back to that checkpoint when ever i used the line "go back to checkpoint" so basically a temporary jump command, but once the program ends it's no longer there?
You need to be more specificcc. Where are you typing Checkpoint? On the console of a C++ program that you wrote?
I don't quite get what you are asking, either.

so basically a temporary jump command, but once the program ends it's no longer there?


When the program ends, the memory gets cleared up, so no commands are there any longer. The way you are asking the question is probably perfectly understandable to you, but we are (or at least I am) not interpreting the question in the manner in which it was asked. The beginning of your question almost sounds like you are asking if C++ supports function calls, but the end of the question certainly is asking about something else.

Please give a more descriptive example of what you are trying to accomplish. There may be a better solution than a "temporary jump" command, whatever you are intending by that.
good debuggers have the concept of a breakpoint and its good friend the conditional breakpoint.
using these, you can have the code run as normal until it hits some condition, then it stops there and you can take a look. These are not present when not running the debugger. This won't help you jump the instruction pointer around, though.

it sounds like you are asking about self modifying code. Its possible, its been done, its bad practice and risky.

you can keep a trace of your program and 'go backwards' sort of. It would reset all the variables to a previous recorded state and restart the code from whatever function was next to execute (also part of your recorded state). This is not trivial to get working correctly, but its doable.
Last edited on
Topic archived. No new replies allowed.