How do i write the 'press r to repeat' code thing in C
Go to solution
Solved by minibois,
Work with functions and have the R button trigger the function, so it outputs what you want.
Just make most of your code into a function and have that function triggered once by the main and then have it trigger itself
I don't know how to write C and I can't copy your code because it's a screenshot, so here is some pseudocode:
int main() { RunVATCode(); } void RunVATCode() { // Insert the code above here // if the user presses R? run RunVATCode(); again // Else? terminate program. }
There are of course dozens of other ways to achieve this, but this would IMO be the simplest to implement, just have a function that calls itself, or terminates the program.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now