I just discovered threads because I needed to have two independent while loops.
In my main program, I want to be able to create and start a thread that is able to modify local variables in the main thread. If I define "int number = 1;" in main, can a thread started in the main program access and modify number ? I envision multiple threads containing a while loop that run continuously checking and updating various variables.
What I have tried:
So far I have
int number = 1;
I think I know how to create thread objects that call on methods.