I have a class main.cpp
, as well as MyClass.cpp
.
In main.cpp
, I have a lot of code. At the top though, I create a MyClass
object and then I'd like to start a thread that is in MyClass
. I'd like it to call a function Run()
and have the function run at the same time that the rest of the functions in main.cpp
run.
What is the easiest way to do this in C++. I've never done threading in C++, however I have done so in Java.
I'd like to avoid using external packages and such if possible.